summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2017-06-15 13:23:32 +0200
committerGitHub <noreply@github.com>2017-06-15 13:23:32 +0200
commit8ccc2e27586d4c77dd68f8e5fcf696d39af012a2 (patch)
treefed1a6309b857bc196be7ebf55b6c1cd025b6788
parentca3c69c8ae0fd7f0d13e87d7861c54e2950a2c09 (diff)
parent0f92a2c6fdce9130433d54f62725abfc6d692e9d (diff)
downloadnextcloud-server-8ccc2e27586d4c77dd68f8e5fcf696d39af012a2.tar.gz
nextcloud-server-8ccc2e27586d4c77dd68f8e5fcf696d39af012a2.zip
Merge pull request #5396 from nextcloud/gpx-mimetype
add gpx mimetype
-rw-r--r--core/img/filetypes/location.svg2
-rw-r--r--core/js/mimetypelist.js7
-rw-r--r--lib/private/Repair/RepairMimeTypes.php15
-rw-r--r--resources/config/mimetypealiases.dist.json5
-rw-r--r--resources/config/mimetypemapping.dist.json4
5 files changed, 32 insertions, 1 deletions
diff --git a/core/img/filetypes/location.svg b/core/img/filetypes/location.svg
new file mode 100644
index 00000000000..737b1dd662a
--- /dev/null
+++ b/core/img/filetypes/location.svg
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 100 100" xml:space="preserve" height="32" width="32" version="1.1" y="0px" x="0px" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" viewBox="0 0 32 32"><path d="m16.274 1c-5.674 0-10.274 4.6006-10.274 10.274 0 5.674 10.274 19.726 10.274 19.726s10.274-14.052 10.274-19.726c0-5.6734-4.601-10.274-10.274-10.274zm0 16.027c-3.1775 0-5.7529-2.5754-5.7529-5.7537 0-3.1775 2.5754-5.7522 5.7529-5.7522 3.1782 0 5.7529 2.5747 5.7529 5.7522 0.00074 3.1783-2.5747 5.7537-5.7529 5.7537z" fill="#969696"/></svg>
diff --git a/core/js/mimetypelist.js b/core/js/mimetypelist.js
index 89558e21086..b0104b50bef 100644
--- a/core/js/mimetypelist.js
+++ b/core/js/mimetypelist.js
@@ -12,6 +12,7 @@ OC.MimeTypeList={
"application/epub+zip": "text",
"application/font-sfnt": "image",
"application/font-woff": "image",
+ "application/gpx+xml": "location",
"application/illustrator": "image",
"application/javascript": "text/code",
"application/json": "text/code",
@@ -25,6 +26,9 @@ OC.MimeTypeList={
"application/rss+xml": "application/xml",
"application/vnd.android.package-archive": "package/x-generic",
"application/vnd.lotus-wordpro": "x-office/document",
+ "application/vnd.garmin.tcx+xml": "location",
+ "application/vnd.google-earth.kml+xml": "location",
+ "application/vnd.google-earth.kmz": "location",
"application/vnd.ms-excel": "x-office/spreadsheet",
"application/vnd.ms-excel.addin.macroEnabled.12": "x-office/spreadsheet",
"application/vnd.ms-excel.sheet.binary.macroEnabled.12": "x-office/spreadsheet",
@@ -86,8 +90,8 @@ OC.MimeTypeList={
"text/x-c": "text/code",
"text/x-c++src": "text/code",
"text/x-h": "text/code",
- "text/x-ldif": "text/code",
"text/x-java-source": "text/code",
+ "text/x-ldif": "text/code",
"text/x-python": "text/code",
"text/x-shellscript": "text/code",
"web": "text/code"
@@ -104,6 +108,7 @@ OC.MimeTypeList={
"folder-shared",
"folder-starred",
"image",
+ "location",
"package-x-generic",
"text",
"text-calendar",
diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php
index d60b507e932..0bf35c1d2ae 100644
--- a/lib/private/Repair/RepairMimeTypes.php
+++ b/lib/private/Repair/RepairMimeTypes.php
@@ -129,6 +129,17 @@ class RepairMimeTypes implements IRepairStep {
$this->updateMimetypes($updatedMimetypes);
}
+ private function introduceLocationTypes() {
+ $updatedMimetypes = [
+ 'gpx' => 'application/gpx+xml',
+ 'kml' => 'application/vnd.google-earth.kml+xml',
+ 'kmz' => 'application/vnd.google-earth.kmz',
+ 'tcx' => 'application/vnd.garmin.tcx+xml',
+ ];
+
+ $this->updateMimetypes($updatedMimetypes);
+ }
+
/**
* Fix mime types
*/
@@ -146,5 +157,9 @@ class RepairMimeTypes implements IRepairStep {
if (version_compare($ocVersionFromBeforeUpdate, '12.0.0.13', '<') && $this->introduceWindowsProgramTypes()) {
$out->info('Fixed windows program mime types');
}
+
+ if (version_compare($ocVersionFromBeforeUpdate, '13.0.0.0', '<') && $this->introduceLocationTypes()) {
+ $out->info('Fixed geospatial mime types');
+ }
}
}
diff --git a/resources/config/mimetypealiases.dist.json b/resources/config/mimetypealiases.dist.json
index 602f70393ae..2c2ea28059c 100644
--- a/resources/config/mimetypealiases.dist.json
+++ b/resources/config/mimetypealiases.dist.json
@@ -12,6 +12,7 @@
"application/epub+zip": "text",
"application/font-sfnt": "image",
"application/font-woff": "image",
+ "application/gpx+xml": "location",
"application/illustrator": "image",
"application/javascript": "text/code",
"application/json": "text/code",
@@ -25,6 +26,9 @@
"application/rss+xml": "application/xml",
"application/vnd.android.package-archive": "package/x-generic",
"application/vnd.lotus-wordpro": "x-office/document",
+ "application/vnd.garmin.tcx+xml": "location",
+ "application/vnd.google-earth.kml+xml": "location",
+ "application/vnd.google-earth.kmz": "location",
"application/vnd.ms-excel": "x-office/spreadsheet",
"application/vnd.ms-excel.addin.macroEnabled.12": "x-office/spreadsheet",
"application/vnd.ms-excel.sheet.binary.macroEnabled.12": "x-office/spreadsheet",
@@ -87,6 +91,7 @@
"text/x-c++src": "text/code",
"text/x-h": "text/code",
"text/x-java-source": "text/code",
+ "text/x-ldif": "text/code",
"text/x-python": "text/code",
"text/x-shellscript": "text/code",
"web": "text/code"
diff --git a/resources/config/mimetypemapping.dist.json b/resources/config/mimetypemapping.dist.json
index 09be65dd86f..ae90a138a42 100644
--- a/resources/config/mimetypemapping.dist.json
+++ b/resources/config/mimetypemapping.dist.json
@@ -58,6 +58,7 @@
"flac": ["audio/flac"],
"flv": ["video/x-flv"],
"gif": ["image/gif"],
+ "gpx": ["application/gpx+xml"],
"gz": ["application/x-gzip"],
"gzip": ["application/x-gzip"],
"h": ["text/x-h"],
@@ -81,6 +82,8 @@
"kdc": ["image/x-dcraw"],
"key": ["application/x-iwork-keynote-sffkey"],
"keynote": ["application/x-iwork-keynote-sffkey"],
+ "kml": ["application/vnd.google-earth.kml+xml"],
+ "kmz": ["application/vnd.google-earth.kmz"],
"kra": ["application/x-krita"],
"ldif": ["text/x-ldif"],
"lwp": ["application/vnd.lotus-wordpro"],
@@ -159,6 +162,7 @@
"tar.bz2": ["application/x-bzip2"],
"tar.gz": ["application/x-compressed"],
"tbz2": ["application/x-bzip2"],
+ "tcx": ["application/vnd.garmin.tcx+xml"],
"tex": ["application/x-tex"],
"tgz": ["application/x-compressed"],
"tiff": ["image/tiff"],