From 0d2e05a0b57723b9f3dddc3ef2ad59c1844d7697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 11 Oct 2021 09:03:01 +0200 Subject: [PATCH] Add OpenDocument flat mimetypes and x-office/drawing alias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- core/img/filetypes/x-office-drawing.svg | 1 + core/js/mimetypelist.js | 7 +++++++ lib/private/Repair/RepairMimeTypes.php | 15 +++++++++++++++ resources/config/mimetypealiases.dist.json | 6 ++++++ resources/config/mimetypemapping.dist.json | 4 ++++ version.php | 2 +- 6 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 core/img/filetypes/x-office-drawing.svg diff --git a/core/img/filetypes/x-office-drawing.svg b/core/img/filetypes/x-office-drawing.svg new file mode 100644 index 00000000000..352347b6348 --- /dev/null +++ b/core/img/filetypes/x-office-drawing.svg @@ -0,0 +1 @@ + diff --git a/core/js/mimetypelist.js b/core/js/mimetypelist.js index bd9b2bd69f1..a891aeec95c 100644 --- a/core/js/mimetypelist.js +++ b/core/js/mimetypelist.js @@ -55,7 +55,13 @@ OC.MimeTypeList={ "application/vnd.oasis.opendocument.text": "x-office/document", "application/vnd.oasis.opendocument.text-master": "x-office/document", "application/vnd.oasis.opendocument.text-template": "x-office/document", + "application/vnd.oasis.opendocument.graphics": "x-office/drawing", + "application/vnd.oasis.opendocument.graphics-template": "x-office/drawing", "application/vnd.oasis.opendocument.text-web": "x-office/document", + "application/vnd.oasis.opendocument.text-flat-xml": "x-office/document", + "application/vnd.oasis.opendocument.spreadsheet-flat-xml": "x-office/spreadsheet", + "application/vnd.oasis.opendocument.graphics-flat-xml": "x-office/drawing", + "application/vnd.oasis.opendocument.presentation-flat-xml": "x-office/presentation", "application/vnd.openxmlformats-officedocument.presentationml.presentation": "x-office/presentation", "application/vnd.openxmlformats-officedocument.presentationml.slideshow": "x-office/presentation", "application/vnd.openxmlformats-officedocument.presentationml.template": "x-office/presentation", @@ -129,6 +135,7 @@ OC.MimeTypeList={ "text-vcard", "video", "x-office-document", + "x-office-drawing", "x-office-presentation", "x-office-spreadsheet" ], diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index b5c17e85147..61512627258 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -192,6 +192,17 @@ class RepairMimeTypes implements IRepairStep { return $this->updateMimetypes($updatedMimetypes); } + private function introduceFlatOpenDocumentType() { + $updatedMimetypes = [ + "fodt" => "application/vnd.oasis.opendocument.text-flat-xml", + "fods" => "application/vnd.oasis.opendocument.spreadsheet-flat-xml", + "fodg" => "application/vnd.oasis.opendocument.graphics-flat-xml", + "fodp" => "application/vnd.oasis.opendocument.presentation-flat-xml", + ]; + + return $this->updateMimetypes($updatedMimetypes); + } + private function introduceOrgModeType() { $updatedMimetypes = [ 'org' => 'text/org' @@ -245,5 +256,9 @@ class RepairMimeTypes implements IRepairStep { if (version_compare($ocVersionFromBeforeUpdate, '21.0.0.7', '<') && $this->introduceOrgModeType()) { $out->info('Fixed orgmode mime types'); } + + if (version_compare($ocVersionFromBeforeUpdate, '23.0.0.2', '<') && $this->introduceFlatOpenDocumentType()) { + $out->info('Fixed Flat OpenDocument mime types'); + } } } diff --git a/resources/config/mimetypealiases.dist.json b/resources/config/mimetypealiases.dist.json index 9d0c070d1fa..891b9a72ce5 100644 --- a/resources/config/mimetypealiases.dist.json +++ b/resources/config/mimetypealiases.dist.json @@ -55,7 +55,13 @@ "application/vnd.oasis.opendocument.text": "x-office/document", "application/vnd.oasis.opendocument.text-master": "x-office/document", "application/vnd.oasis.opendocument.text-template": "x-office/document", + "application/vnd.oasis.opendocument.graphics": "x-office/drawing", + "application/vnd.oasis.opendocument.graphics-template": "x-office/drawing", "application/vnd.oasis.opendocument.text-web": "x-office/document", + "application/vnd.oasis.opendocument.text-flat-xml": "x-office/document", + "application/vnd.oasis.opendocument.spreadsheet-flat-xml": "x-office/spreadsheet", + "application/vnd.oasis.opendocument.graphics-flat-xml": "x-office/drawing", + "application/vnd.oasis.opendocument.presentation-flat-xml": "x-office/presentation", "application/vnd.openxmlformats-officedocument.presentationml.presentation": "x-office/presentation", "application/vnd.openxmlformats-officedocument.presentationml.slideshow": "x-office/presentation", "application/vnd.openxmlformats-officedocument.presentationml.template": "x-office/presentation", diff --git a/resources/config/mimetypemapping.dist.json b/resources/config/mimetypemapping.dist.json index b38046aef32..54bf073fb80 100644 --- a/resources/config/mimetypemapping.dist.json +++ b/resources/config/mimetypemapping.dist.json @@ -127,6 +127,10 @@ "ots": ["application/vnd.oasis.opendocument.spreadsheet-template"], "otp": ["application/vnd.oasis.opendocument.presentation-template"], "otg": ["application/vnd.oasis.opendocument.graphics-template"], + "fodt": ["application/vnd.oasis.opendocument.text-flat-xml"], + "fods": ["application/vnd.oasis.opendocument.spreadsheet-flat-xml"], + "fodg": ["application/vnd.oasis.opendocument.graphics-flat-xml"], + "fodp": ["application/vnd.oasis.opendocument.presentation-flat-xml"], "oga": ["audio/ogg"], "ogg": ["audio/ogg"], "ogv": ["video/ogg"], diff --git a/version.php b/version.php index 045fa2866b6..d2bb661dba3 100644 --- a/version.php +++ b/version.php @@ -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 = [23, 0, 0, 1]; +$OC_Version = [23, 0, 0, 2]; // The human readable string $OC_VersionString = '23.0.0 alpha';