mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Merge pull request #54737 from nextcloud/feat/text-ext
feat: Add text/plain MIME type mapping for 'text' extension
This commit is contained in:
commit
61bb2dca40
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"],
|
||||
|
|
|
|||
Loading…
Reference in a new issue