From dea865d24737b00ed17854513138faa5d8acbdbb Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Tue, 28 Nov 2023 17:12:21 +0100 Subject: [PATCH] fix: add mimetype for eml and msg Signed-off-by: Daniel Kesselberg --- lib/private/Repair/RepairMimeTypes.php | 13 +++++++++++++ resources/config/mimetypemapping.dist.json | 2 ++ version.php | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index f951c3b916d..0d9e744b213 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -237,6 +237,15 @@ class RepairMimeTypes implements IRepairStep { return $this->updateMimetypes($updatedMimetypes); } + private function introduceEmlAndMsgFormatType() { + $updatedMimetypes = [ + 'eml' => 'message/rfc822', + 'msg' => 'application/x-ole-storage', + ]; + + return $this->updateMimetypes($updatedMimetypes); + } + /** * Fix mime types */ @@ -297,5 +306,9 @@ class RepairMimeTypes implements IRepairStep { if (version_compare($ocVersionFromBeforeUpdate, '28.0.0.5', '<') && $this->introduceEnhancedMetafileFormatType()) { $out->info('Fixed Enhanced Metafile Format mime types'); } + + if (version_compare($ocVersionFromBeforeUpdate, '29.0.0.1', '<') && $this->introduceEmlAndMsgFormatType()) { + $out->info('Fixed eml and msg mime type'); + } } } diff --git a/resources/config/mimetypemapping.dist.json b/resources/config/mimetypemapping.dist.json index 47b207d6bcc..b28dd42cd1e 100644 --- a/resources/config/mimetypemapping.dist.json +++ b/resources/config/mimetypemapping.dist.json @@ -53,6 +53,7 @@ "dotx": ["application/vnd.openxmlformats-officedocument.wordprocessingml.template"], "dv": ["video/dv"], "emf": ["image/emf"], + "eml": ["message/rfc822", "text/plain"], "eot": ["application/vnd.ms-fontobject"], "eps": ["application/postscript"], "epub": ["application/epub+zip"], @@ -122,6 +123,7 @@ "mpeg": ["video/mpeg"], "mpg": ["video/mpeg"], "mpo": ["image/jpeg"], + "msg": ["application/x-ole-storage", "text/plain"], "msi": ["application/x-msi"], "mt2s": ["video/MP2T"], "mts": ["video/MP2T"], diff --git a/version.php b/version.php index 7cf870d5d0a..65fd747e718 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/patch level // when updating major/minor version number. -$OC_Version = [29, 0, 0, 0]; +$OC_Version = [29, 0, 0, 1]; // The human-readable string $OC_VersionString = '29.0.0 dev'; -- 2.39.5