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 27, 2022
1 parent 8dcab81 commit f40d78d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 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"
}

2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel
// when updating major/minor version number.

$OC_Version = [25, 0, 0, 1];
$OC_Version = [25, 0, 0, 2];

// The human readable string
$OC_VersionString = '25.0.0 dev';
Expand Down

0 comments on commit f40d78d

Please sign in to comment.