diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-09-10 12:42:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-10 12:42:29 +0200 |
commit | 9708b004f75b543ed95f29e3a2993b5ee532a61c (patch) | |
tree | 36e821144e1d0c0d46551e3f62a7657d52a77b63 | |
parent | bd5a297c93990a123c0187e3f1b866e3dc0bd431 (diff) | |
parent | b0970f86f03cf5f13f2550ae2521f87cf2806072 (diff) | |
download | nextcloud-server-9708b004f75b543ed95f29e3a2993b5ee532a61c.tar.gz nextcloud-server-9708b004f75b543ed95f29e3a2993b5ee532a61c.zip |
Merge pull request #22552 from nextcloud/bugfix/noid/opendocument-templates
Add opendocument templates to mimetype mappings
-rw-r--r-- | lib/private/Repair/RepairMimeTypes.php | 15 | ||||
-rw-r--r-- | resources/config/mimetypemapping.dist.json | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index b6b6ceed104..60a7df25f63 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -191,6 +191,17 @@ class RepairMimeTypes implements IRepairStep { return $this->updateMimetypes($updatedMimetypes); } + private function introduceOpenDocumentTemplates() { + $updatedMimetypes = [ + 'ott' => 'application/vnd.oasis.opendocument.text-template', + 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', + 'otp' => 'application/vnd.oasis.opendocument.presentation-template', + 'otg' => 'application/vnd.oasis.opendocument.graphics-template', + ]; + + return $this->updateMimetypes($updatedMimetypes); + } + /** * Fix mime types */ @@ -227,5 +238,9 @@ class RepairMimeTypes implements IRepairStep { if (version_compare($ocVersionFromBeforeUpdate, '14.0.0.10', '<') && $this->introduceComicbookTypes()) { $out->info('Fixed comicbook mime types'); } + + if (version_compare($ocVersionFromBeforeUpdate, '20.0.0.5', '<') && $this->introduceOpenDocumentTemplates()) { + $out->info('Fixed OpenDocument template mime types'); + } } } diff --git a/resources/config/mimetypemapping.dist.json b/resources/config/mimetypemapping.dist.json index 97b2f74ff0e..eedf45e5f9b 100644 --- a/resources/config/mimetypemapping.dist.json +++ b/resources/config/mimetypemapping.dist.json @@ -123,6 +123,10 @@ "odp": ["application/vnd.oasis.opendocument.presentation"], "ods": ["application/vnd.oasis.opendocument.spreadsheet"], "odt": ["application/vnd.oasis.opendocument.text"], + "ott": ["application/vnd.oasis.opendocument.text-template"], + "ots": ["application/vnd.oasis.opendocument.spreadsheet-template"], + "otp": ["application/vnd.oasis.opendocument.presentation-template"], + "otg": ["application/vnd.oasis.opendocument.graphics-template"], "oga": ["audio/ogg"], "ogg": ["audio/ogg"], "ogv": ["video/ogg"], |