Skip to content

Commit

Permalink
feat: add docxf and form mimetypes
Browse files Browse the repository at this point in the history
signed-off-by: Luka Trovic <luka@nextcloud.com>
  • Loading branch information
luka-nextcloud committed May 25, 2022
1 parent d32f683 commit 68886b5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
5 changes: 4 additions & 1 deletion core/js/mimetypelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ OC.MimeTypeList={
"application/internet-shortcut": "link",
"application/km": "mindmap",
"application/x-freemind": "mindmap",
"application/vnd.xmind.workbook": "mindmap"
"application/vnd.xmind.workbook": "mindmap",
"image/targa": "image/tga",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform": "x-office/form",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf": "x-office/form-template"
},
files: [
"application",
Expand Down
13 changes: 13 additions & 0 deletions lib/private/Repair/RepairMimeTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ private function introduceOrgModeType() {
return $this->updateMimetypes($updatedMimetypes);
}

private function introduceOnlyofficeFormType() {
$updatedMimetypes = [
"oform" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform",
"docxf" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf",
];

return $this->updateMimetypes($updatedMimetypes);
}


/**
* Fix mime types
Expand Down Expand Up @@ -260,5 +269,9 @@ public function run(IOutput $out) {
if (version_compare($ocVersionFromBeforeUpdate, '23.0.0.2', '<') && $this->introduceFlatOpenDocumentType()) {
$out->info('Fixed Flat OpenDocument mime types');
}

if (version_compare($ocVersionFromBeforeUpdate, '23.0.0.2', '<') && $this->introduceOnlyofficeFormType()) {
$out->info('Fixed ONLYOFFICE Forms OpenXML mime types');
}
}
}
4 changes: 3 additions & 1 deletion resources/config/mimetypealiases.dist.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
"application/km": "mindmap",
"application/x-freemind": "mindmap",
"application/vnd.xmind.workbook": "mindmap",
"image/targa": "image/tga"
"image/targa": "image/tga",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform": "x-office/form",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf": "x-office/form-template"
}

0 comments on commit 68886b5

Please sign in to comment.