feat: Add text/plain MIME type mapping for 'text' extension

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
pull/54737/head
Marcel Klehr 2025-08-29 13:53:20 +07:00
parent bcc8ff7b13
commit 8c93c00fd7
2 changed files with 17 additions and 0 deletions

@ -350,6 +350,18 @@ class RepairMimeTypes implements IRepairStep {
return $this->updateMimetypes($updatedMimetypes);
}
/**
* @throws Exception
* @since 32.0.0
*/
private function introduceTextType(): IResult|int|null {
$updatedMimetypes = [
'text' => 'text/plain',
];
return $this->updateMimetypes($updatedMimetypes);
}
/**
@ -466,6 +478,10 @@ class RepairMimeTypes implements IRepairStep {
$out->info('Fixed musicxml mime type');
}
if (version_compare($mimeTypeVersion, '32.0.0.0', '<') && $this->introduceTextType()) {
$out->info('Fixed text mime type');
}
if (!$this->dryRun) {
$this->appConfig->setValueString('files', 'mimetype_version', $serverVersion);
}

@ -199,6 +199,7 @@
"tif": ["image/tiff"],
"tiff": ["image/tiff"],
"ttf": ["application/font-sfnt"],
"text": ["text/plain"],
"txt": ["text/plain"],
"url": ["application/internet-shortcut"],
"vcard": ["text/vcard"],