Skip to content

Commit

Permalink
Merge pull request #22552 from nextcloud/bugfix/noid/opendocument-tem…
Browse files Browse the repository at this point in the history
…plates

Add opendocument templates to mimetype mappings
  • Loading branch information
MorrisJobke authored Sep 10, 2020
2 parents bd5a297 + b0970f8 commit 9708b00
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/private/Repair/RepairMimeTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,17 @@ private function introduceComicbookTypes() {
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
*/
Expand Down Expand Up @@ -227,5 +238,9 @@ public function run(IOutput $out) {
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');
}
}
}
4 changes: 4 additions & 0 deletions resources/config/mimetypemapping.dist.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit 9708b00

Please sign in to comment.