Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-04 18:49:31 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-04 18:49:31 +0300
commitd8faeab4219bc1426ff90957dbf0bee59e463d88 (patch)
treea818ba48f5da43a9071e45f07e9b9dd35827a131
parent089b60cd255ecfc7b25c2f5b36179c2bdc46bcf6 (diff)
parent6ffd8f3e0d325f22667d4739eee037a07b38d50c (diff)
Merge pull request #21766 from farukuzun/master
Add some mimetypes
-rw-r--r--core/js/mimetypelist.js4
-rw-r--r--lib/private/repair/repairmimetypes.php17
-rw-r--r--resources/config/mimetypealiases.dist.json4
-rw-r--r--resources/config/mimetypemapping.dist.json4
-rw-r--r--tests/lib/repair/repairmimetypes.php29
-rw-r--r--version.php2
6 files changed, 59 insertions, 1 deletions
diff --git a/core/js/mimetypelist.js b/core/js/mimetypelist.js
index dea065814d1..89c6e8c4d4e 100644
--- a/core/js/mimetypelist.js
+++ b/core/js/mimetypelist.js
@@ -17,12 +17,14 @@ OC.MimeTypeList={
"application/json": "text/code",
"application/msaccess": "file",
"application/msexcel": "x-office/spreadsheet",
+ "application/msonenote": "x-office/document",
"application/mspowerpoint": "x-office/presentation",
"application/msword": "x-office/document",
"application/octet-stream": "file",
"application/postscript": "image",
"application/rss+xml": "application/xml",
"application/vnd.android.package-archive": "package/x-generic",
+ "application/vnd.lotus-wordpro": "x-office/document",
"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",
@@ -51,6 +53,8 @@ OC.MimeTypeList={
"application/vnd.openxmlformats-officedocument.spreadsheetml.template": "x-office/spreadsheet",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "x-office/document",
"application/vnd.openxmlformats-officedocument.wordprocessingml.template": "x-office/document",
+ "application/vnd.visio": "x-office/document",
+ "application/vnd.wordperfect": "x-office/document",
"application/x-7z-compressed": "package/x-generic",
"application/x-cbr": "text",
"application/x-compressed": "package/x-generic",
diff --git a/lib/private/repair/repairmimetypes.php b/lib/private/repair/repairmimetypes.php
index 692a7120a63..b84f19a3082 100644
--- a/lib/private/repair/repairmimetypes.php
+++ b/lib/private/repair/repairmimetypes.php
@@ -293,6 +293,17 @@ class RepairMimeTypes extends BasicEmitter implements \OC\RepairStep {
self::updateMimetypes($updatedMimetypes);
}
+ private function introduceRichDocumentsMimeTypes() {
+ $updatedMimetypes = array(
+ 'lwp' => 'application/vnd.lotus-wordpro',
+ 'one' => 'application/msonenote',
+ 'vsd' => 'application/vnd.visio',
+ 'wpd' => 'application/vnd.wordperfect',
+ );
+
+ self::updateMimetypes($updatedMimetypes);
+ }
+
/**
* Fix mime types
*/
@@ -356,5 +367,11 @@ class RepairMimeTypes extends BasicEmitter implements \OC\RepairStep {
$this->emit('\OC\Repair', 'info', array('Fixed rtf mime type'));
}
}
+
+ if (version_compare($ocVersionFromBeforeUpdate, '9.0.0.10', '<')) {
+ if ($this->introduceRichDocumentsMimeTypes()) {
+ $this->emit('\OC\Repair', 'info', array('Fixed richdocuments additional office mime types'));
+ }
+ }
}
}
diff --git a/resources/config/mimetypealiases.dist.json b/resources/config/mimetypealiases.dist.json
index ed471f228e2..545d4b0c399 100644
--- a/resources/config/mimetypealiases.dist.json
+++ b/resources/config/mimetypealiases.dist.json
@@ -17,12 +17,14 @@
"application/json": "text/code",
"application/msaccess": "file",
"application/msexcel": "x-office/spreadsheet",
+ "application/msonenote": "x-office/document",
"application/mspowerpoint": "x-office/presentation",
"application/msword": "x-office/document",
"application/octet-stream": "file",
"application/postscript": "image",
"application/rss+xml": "application/xml",
"application/vnd.android.package-archive": "package/x-generic",
+ "application/vnd.lotus-wordpro": "x-office/document",
"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",
@@ -51,6 +53,8 @@
"application/vnd.openxmlformats-officedocument.spreadsheetml.template": "x-office/spreadsheet",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "x-office/document",
"application/vnd.openxmlformats-officedocument.wordprocessingml.template": "x-office/document",
+ "application/vnd.visio": "x-office/document",
+ "application/vnd.wordperfect": "x-office/document",
"application/x-7z-compressed": "package/x-generic",
"application/x-cbr": "text",
"application/x-compressed": "package/x-generic",
diff --git a/resources/config/mimetypemapping.dist.json b/resources/config/mimetypemapping.dist.json
index e26ec7038b1..d08a46bb017 100644
--- a/resources/config/mimetypemapping.dist.json
+++ b/resources/config/mimetypemapping.dist.json
@@ -76,6 +76,7 @@
"key": ["application/x-iwork-keynote-sffkey"],
"keynote": ["application/x-iwork-keynote-sffkey"],
"kra": ["application/x-krita"],
+ "lwp": ["application/vnd.lotus-wordpro"],
"m2t": ["video/mp2t"],
"m4v": ["video/mp4"],
"markdown": ["text/markdown"],
@@ -106,6 +107,7 @@
"oga": ["audio/ogg"],
"ogg": ["audio/ogg"],
"ogv": ["video/ogg"],
+ "one": ["application/msonenote"],
"opus": ["audio/ogg"],
"orf": ["image/x-dcraw"],
"otf": ["application/font-sfnt"],
@@ -154,9 +156,11 @@
"vcard": ["text/vcard"],
"vcf": ["text/vcard"],
"vob": ["video/dvd"],
+ "vsd": ["application/vnd.visio"],
"wav": ["audio/wav"],
"webm": ["video/webm"],
"woff": ["application/font-woff"],
+ "wpd": ["application/vnd.wordperfect"],
"wmv": ["video/x-ms-wmv"],
"xcf": ["application/x-gimp"],
"xla": ["application/vnd.ms-excel"],
diff --git a/tests/lib/repair/repairmimetypes.php b/tests/lib/repair/repairmimetypes.php
index 1bdaa9a2dbf..a9ebb7bc88a 100644
--- a/tests/lib/repair/repairmimetypes.php
+++ b/tests/lib/repair/repairmimetypes.php
@@ -347,6 +347,27 @@ class RepairMimeTypes extends \Test\TestCase {
}
/**
+ * Test renaming the richdocuments additional office mime types
+ */
+ public function testRenameRichDocumentsMimeTypes() {
+ $currentMimeTypes = [
+ ['test.lwp', 'application/octet-stream'],
+ ['test.one', 'application/octet-stream'],
+ ['test.vsd', 'application/octet-stream'],
+ ['test.wpd', 'application/octet-stream'],
+ ];
+
+ $fixedMimeTypes = [
+ ['test.lwp', 'application/vnd.lotus-wordpro'],
+ ['test.one', 'application/msonenote'],
+ ['test.vsd', 'application/vnd.visio'],
+ ['test.wpd', 'application/vnd.wordperfect'],
+ ];
+
+ $this->renameMimeTypes($currentMimeTypes, $fixedMimeTypes);
+ }
+
+ /**
* Test renaming and splitting old office mime types when
* new ones already exist
*/
@@ -468,6 +489,10 @@ class RepairMimeTypes extends \Test\TestCase {
['test.hpp', 'text/x-h'],
['test.rss', 'application/rss+xml'],
['test.rtf', 'text/rtf'],
+ ['test.lwp', 'application/vnd.lotus-wordpro'],
+ ['test.one', 'application/msonenote'],
+ ['test.vsd', 'application/vnd.visio'],
+ ['test.wpd', 'application/vnd.wordperfect'],
];
$fixedMimeTypes = [
@@ -512,6 +537,10 @@ class RepairMimeTypes extends \Test\TestCase {
['test.hpp', 'text/x-h'],
['test.rss', 'application/rss+xml'],
['test.rtf', 'text/rtf'],
+ ['test.lwp', 'application/vnd.lotus-wordpro'],
+ ['test.one', 'application/msonenote'],
+ ['test.vsd', 'application/vnd.visio'],
+ ['test.wpd', 'application/vnd.wordperfect'],
];
$this->renameMimeTypes($currentMimeTypes, $fixedMimeTypes);
diff --git a/version.php b/version.php
index f807b01d7d0..44bddca0700 100644
--- a/version.php
+++ b/version.php
@@ -25,7 +25,7 @@
// We only can count up. The 4. digit is only for the internal patchlevel to trigger DB upgrades
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel
// when updating major/minor version number.
-$OC_Version = array(9, 0, 0, 9);
+$OC_Version = array(9, 0, 0, 10);
// The human readable string
$OC_VersionString = '9.0 pre alpha';