From da0353dc6a95159581cd7c65f4e0fab8ccfe09ea Mon Sep 17 00:00:00 2001 From: Hoang Pham Date: Thu, 25 Jul 2024 16:55:48 +0700 Subject: [PATCH] feat: support excalidraw file Signed-off-by: Hoang Pham --- lib/private/Repair/RepairMimeTypes.php | 40 ++----------------- .../mimetypeListModified/core/signature.json | 6 +-- 2 files changed, 7 insertions(+), 39 deletions(-) diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index 444a45a1012af..6aee245291eaa 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -308,28 +308,6 @@ private function introduceEmlAndMsgFormatType(): IResult|int|null { return $this->updateMimetypes($updatedMimetypes); } - /** - * @throws Exception - */ - private function introduceAacAudioType(): IResult|int|null { - $updatedMimetypes = [ - 'aac' => 'audio/aac', - ]; - - return $this->updateMimetypes($updatedMimetypes); - } - - /** - * @throws Exception - */ - private function introduceReStructuredTextFormatType(): IResult|int|null { - $updatedMimetypes = [ - 'rst' => 'text/x-rst', - ]; - - return $this->updateMimetypes($updatedMimetypes); - } - /** * @throws Exception */ @@ -341,13 +319,11 @@ public function migrationsAvailable(): bool { } private function getMimeTypeVersion(): string { - $serverVersion = $this->config->getSystemValueString('version', '0.0.0'); - // 29.0.0.10 is the last version with a mimetype migration before it was moved to a separate version number - if (version_compare($serverVersion, '29.0.0.10', '>')) { - return $this->config->getAppValue('files', 'mimetype_version', '29.0.0.10'); + $mimeVersion = $this->config->getAppValue('files', 'mimetype_version', ''); + if ($mimeVersion) { + return $mimeVersion; } - - return $serverVersion; + return $this->config->getSystemValueString('version', '0.0.0'); } /** @@ -418,14 +394,6 @@ public function run(IOutput $out): void { $out->info('Fixed eml and msg mime type'); } - if (version_compare($mimeTypeVersion, '29.0.0.6', '<') && $this->introduceAacAudioType()) { - $out->info('Fixed aac mime type'); - } - - if (version_compare($mimeTypeVersion, '29.0.0.10', '<') && $this->introduceReStructuredTextFormatType()) { - $out->info('Fixed ReStructured Text mime type'); - } - if (version_compare($mimeTypeVersion, '30.0.0.0', '<') && $this->introduceExcalidrawType()) { $out->info('Fixed Excalidraw mime type'); } diff --git a/tests/data/integritycheck/mimetypeListModified/core/signature.json b/tests/data/integritycheck/mimetypeListModified/core/signature.json index a2d6d5ca77ec8..11a92ad9f7fb1 100644 --- a/tests/data/integritycheck/mimetypeListModified/core/signature.json +++ b/tests/data/integritycheck/mimetypeListModified/core/signature.json @@ -1,7 +1,7 @@ { "hashes": { - "core\/js\/mimetypelist.js": "507bb72181a0213598eaa03dbb6f7290b367e06b706aa15873a921c491980a13165c9858924d9b4b478b8444e92bb5e4169f5f971d184b77a63c3fcc5b3acf59" + "core\/js\/mimetypelist.js": "abe5724362ef2a9f1ee549ff3e9a37e6a9438b5ebaafaa945e10eeb7fdad26f93b814ece0db43343a434fcc6bf26b59930b2c914f90611bcb29f746acf0c0aa4" }, - "signature": "qGQx9Sy0ynziPeir6H7dIsTdSjjOrLEEbB+sf00sWpmQ\/izXW9Zd7jeTKgMHfrew+d+NyyR3O5V1m\/FkMtmp61LM1l22VpyuiRctFOs1qSxXmDRu27LLIP3d2yayLqpROOEdJSMgDoQU1yGV05bnK0u2yy3srxZa2XUjTaDRT5M+xRBPuc1CtEQ1azp07Xk7N2FnoGjc3\/TusodpHovlKwUg5uSX5nC5da7KJWJ9luM4B\/etl717Hrauw5xIgi+AryuIjhahaYvnIJcM0yZYkZ7KIqOa6Y\/SZFRC0+kB+KJdu3+ZJ4RTTnxmVVcQ4DN2fEozjr6ZDZGaRY+TnF8UaPopba5xDipHq8A4Qm0DWewOG9G4CFdJViGHYFTmIMWealugQLY6ucDcaYaw+kqa66Es7VX0Use0WJFymlleDchqaRWd1n18rEBjEBmDc8s4pQeXZRu8nCxngYUyKrImKWdLpTnxgThqFTukT\/zkaP6klXWydfISK07aKlil7ha84Ud83g71SwIsq3x4y7BSeXyZGRdkzImqlSwgz60u1ndG6m\/cG3Es01v6ao26H4Rs28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