diff --git a/core/Command/Maintenance/Mimetype/UpdateJS.php b/core/Command/Maintenance/Mimetype/UpdateJS.php index 7908d066c8..f302b4a201 100644 --- a/core/Command/Maintenance/Mimetype/UpdateJS.php +++ b/core/Command/Maintenance/Mimetype/UpdateJS.php @@ -113,7 +113,7 @@ class UpdateJS extends Command { * * You can update the list of MimeType Aliases in config/mimetypealiases.json * The list of files is fetched from core/img/filetypes -* To regenerate this file run ./occ maintenance:mimetypesjs +* To regenerate this file run ./occ maintenance:mimetype:update-js */ OC.MimeTypeList={ aliases: ' . json_encode($aliases, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . ', diff --git a/core/img/filetypes/link.svg b/core/img/filetypes/link.svg new file mode 100644 index 0000000000..999a9deb70 --- /dev/null +++ b/core/img/filetypes/link.svg @@ -0,0 +1 @@ + diff --git a/core/img/places/link.svg b/core/img/places/link.svg index efc9474522..08127c0010 100644 --- a/core/img/places/link.svg +++ b/core/img/places/link.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/core/js/mimetypelist.js b/core/js/mimetypelist.js index b0104b50be..ea513131d8 100644 --- a/core/js/mimetypelist.js +++ b/core/js/mimetypelist.js @@ -4,7 +4,7 @@ * * You can update the list of MimeType Aliases in config/mimetypealiases.json * The list of files is fetched from core/img/filetypes -* To regenerate this file run ./occ maintenance:mimetypesjs +* To regenerate this file run ./occ maintenance:mimetype:update-js */ OC.MimeTypeList={ aliases: { @@ -94,7 +94,8 @@ OC.MimeTypeList={ "text/x-ldif": "text/code", "text/x-python": "text/code", "text/x-shellscript": "text/code", - "web": "text/code" + "web": "text/code", + "application/internet-shortcut": "link" }, files: [ "application", @@ -108,6 +109,7 @@ OC.MimeTypeList={ "folder-shared", "folder-starred", "image", + "link", "location", "package-x-generic", "text", diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index 0bf35c1d2a..74d81be983 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -100,7 +100,7 @@ class RepairMimeTypes implements IRepairStep { // insert mimetype \OC_DB::executeAudited(self::insertStmt(), array($mimetype)); } - + // get target mimetype id $result = \OC_DB::executeAudited(self::getIdStmt(), array($mimetype)); $mimetypeId = $result->fetchOne(); @@ -140,6 +140,15 @@ class RepairMimeTypes implements IRepairStep { $this->updateMimetypes($updatedMimetypes); } + private function introduceInternetShortcutTypes() { + $updatedMimetypes = [ + 'url' => 'application/internet-shortcut', + 'webloc' => 'application/internet-shortcut' + ]; + + $this->updateMimetypes($updatedMimetypes); + } + /** * Fix mime types */ @@ -161,5 +170,9 @@ class RepairMimeTypes implements IRepairStep { if (version_compare($ocVersionFromBeforeUpdate, '13.0.0.0', '<') && $this->introduceLocationTypes()) { $out->info('Fixed geospatial mime types'); } + + if (version_compare($ocVersionFromBeforeUpdate, '13.0.0.3', '<') && $this->introduceInternetShortcutTypes()) { + $out->info('Fixed internet-shortcut mime types'); + } } } diff --git a/resources/config/mimetypemapping.dist.json b/resources/config/mimetypemapping.dist.json index ae90a138a4..06e4d30b9e 100644 --- a/resources/config/mimetypemapping.dist.json +++ b/resources/config/mimetypemapping.dist.json @@ -120,7 +120,7 @@ "ogg": ["audio/ogg"], "ogv": ["video/ogg"], "one": ["application/msonenote"], - "opus": ["audio/ogg"], + "opus": ["audio/ogg"], "orf": ["image/x-dcraw"], "otf": ["application/font-sfnt"], "pages": ["application/x-iwork-pages-sffpages"], @@ -193,5 +193,7 @@ "xrf": ["image/x-dcraw"], "yaml": ["application/yaml", "text/plain"], "yml": ["application/yaml", "text/plain"], - "zip": ["application/zip"] + "zip": ["application/zip"], + "url": ["application/internet-shortcut"], + "webloc": ["application/internet-shortcut"] }