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:
authorJulius Härtl <jus@bitgrid.net>2022-06-08 01:47:46 +0300
committerGitHub <noreply@github.com>2022-06-08 01:47:46 +0300
commit0f6fc3284d590ac77d7822f8bd297486c77361eb (patch)
tree00cae596c18b8ce0ec81c763ed702271d721cdfd
parentdcf25d6c7716daa08eb6af07a720c0a0b7b6eda6 (diff)
parent50ed84fe17791861f141cd33020ad4f4d86e6673 (diff)
Merge pull request #32481 from nextcloud/feature/add-docxf-form-mimetypes
Add docxf and form mimetypes
-rw-r--r--core/img/filetypes/x-office-form-template.svg5
-rw-r--r--core/img/filetypes/x-office-form.svg5
-rw-r--r--core/js/mimetypelist.js7
-rw-r--r--lib/private/IntegrityCheck/Checker.php3
-rw-r--r--lib/private/Repair/RepairMimeTypes.php13
-rw-r--r--resources/config/mimetypealiases.dist.json4
-rw-r--r--tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js9
-rw-r--r--tests/data/integritycheck/mimetypeListModified/core/signature.json7
-rw-r--r--tests/lib/IntegrityCheck/CheckerTest.php284
-rw-r--r--version.php2
10 files changed, 81 insertions, 258 deletions
diff --git a/core/img/filetypes/x-office-form-template.svg b/core/img/filetypes/x-office-form-template.svg
new file mode 100644
index 00000000000..cc8ba8f13ea
--- /dev/null
+++ b/core/img/filetypes/x-office-form-template.svg
@@ -0,0 +1,5 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M2.5 1C2.22 1 2 1.22 2 1.5V14.5C2 14.78 2.22 15 2.5 15H13.5C13.78 15 14 14.78 14 14.5V4L11 1H2.5Z" fill="#27ABA3"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M12 6H4V9H12V6ZM11 7H5V8H11V7Z" fill="white"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M12 10H4V13H12V10ZM11 11H5V12H11V11Z" fill="white"/>
+</svg>
diff --git a/core/img/filetypes/x-office-form.svg b/core/img/filetypes/x-office-form.svg
new file mode 100644
index 00000000000..5defac8920b
--- /dev/null
+++ b/core/img/filetypes/x-office-form.svg
@@ -0,0 +1,5 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M2.5 1C2.22 1 2 1.22 2 1.5V14.5C2 14.78 2.22 15 2.5 15H13.5C13.78 15 14 14.78 14 14.5V4L11 1H2.5Z" fill="#188079"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M12 6H4V12H12V6ZM3 5V13H13V5H3Z" fill="white" fill-opacity="0.95"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M8 7V8L7 8V10H8V11H5V10H6V8L5 8V7H8Z" fill="white"/>
+</svg>
diff --git a/core/js/mimetypelist.js b/core/js/mimetypelist.js
index a891aeec95c..d861695c0ac 100644
--- a/core/js/mimetypelist.js
+++ b/core/js/mimetypelist.js
@@ -110,7 +110,10 @@ OC.MimeTypeList={
"application/internet-shortcut": "link",
"application/km": "mindmap",
"application/x-freemind": "mindmap",
- "application/vnd.xmind.workbook": "mindmap"
+ "application/vnd.xmind.workbook": "mindmap",
+ "image/targa": "image/tga",
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform": "x-office/form",
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf": "x-office/form-template"
},
files: [
"application",
@@ -136,6 +139,8 @@ OC.MimeTypeList={
"video",
"x-office-document",
"x-office-drawing",
+ "x-office-form",
+ "x-office-form-template",
"x-office-presentation",
"x-office-spreadsheet"
],
diff --git a/lib/private/IntegrityCheck/Checker.php b/lib/private/IntegrityCheck/Checker.php
index 273eba35446..ba555cff438 100644
--- a/lib/private/IntegrityCheck/Checker.php
+++ b/lib/private/IntegrityCheck/Checker.php
@@ -201,7 +201,8 @@ class Checker {
if ($filename === $this->environmentHelper->getServerRoot() . '/core/js/mimetypelist.js') {
$oldMimetypeList = new GenerateMimetypeFileBuilder();
$newFile = $oldMimetypeList->generateFile($this->mimeTypeDetector->getAllAliases());
- if ($newFile === file_get_contents($filename)) {
+ $oldFile = $this->fileAccessHelper->file_get_contents($filename);
+ if ($newFile === $oldFile) {
$hashes[$relativeFileName] = hash('sha512', $oldMimetypeList->generateFile($this->mimeTypeDetector->getOnlyDefaultAliases()));
continue;
}
diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php
index 61512627258..5b216331dc7 100644
--- a/lib/private/Repair/RepairMimeTypes.php
+++ b/lib/private/Repair/RepairMimeTypes.php
@@ -211,6 +211,15 @@ class RepairMimeTypes implements IRepairStep {
return $this->updateMimetypes($updatedMimetypes);
}
+ private function introduceOnlyofficeFormType() {
+ $updatedMimetypes = [
+ "oform" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform",
+ "docxf" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf",
+ ];
+
+ return $this->updateMimetypes($updatedMimetypes);
+ }
+
/**
* Fix mime types
@@ -260,5 +269,9 @@ class RepairMimeTypes implements IRepairStep {
if (version_compare($ocVersionFromBeforeUpdate, '23.0.0.2', '<') && $this->introduceFlatOpenDocumentType()) {
$out->info('Fixed Flat OpenDocument mime types');
}
+
+ if (version_compare($ocVersionFromBeforeUpdate, '25.0.0.2', '<') && $this->introduceOnlyofficeFormType()) {
+ $out->info('Fixed ONLYOFFICE Forms OpenXML mime types');
+ }
}
}
diff --git a/resources/config/mimetypealiases.dist.json b/resources/config/mimetypealiases.dist.json
index 891b9a72ce5..1840dca5fb9 100644
--- a/resources/config/mimetypealiases.dist.json
+++ b/resources/config/mimetypealiases.dist.json
@@ -111,6 +111,8 @@
"application/km": "mindmap",
"application/x-freemind": "mindmap",
"application/vnd.xmind.workbook": "mindmap",
- "image/targa": "image/tga"
+ "image/targa": "image/tga",
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform": "x-office/form",
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf": "x-office/form-template"
}
diff --git a/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js b/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js
index 2625a3c3016..a5d6599ef62 100644
--- a/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js
+++ b/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js
@@ -9,7 +9,6 @@
OC.MimeTypeList={
aliases: {
"application/coreldraw": "image",
- "application/test": "image",
"application/epub+zip": "text",
"application/font-sfnt": "image",
"application/font-woff": "image",
@@ -111,7 +110,11 @@ OC.MimeTypeList={
"application/internet-shortcut": "link",
"application/km": "mindmap",
"application/x-freemind": "mindmap",
- "application/vnd.xmind.workbook": "mindmap"
+ "application/vnd.xmind.workbook": "mindmap",
+ "image/targa": "image/tga",
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform": "x-office/form",
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf": "x-office/form-template",
+ "my-custom/mimetype": "custom"
},
files: [
"application",
@@ -137,6 +140,8 @@ OC.MimeTypeList={
"video",
"x-office-document",
"x-office-drawing",
+ "x-office-form",
+ "x-office-form-template",
"x-office-presentation",
"x-office-spreadsheet"
],
diff --git a/tests/data/integritycheck/mimetypeListModified/core/signature.json b/tests/data/integritycheck/mimetypeListModified/core/signature.json
new file mode 100644
index 00000000000..c963c416708
--- /dev/null
+++ b/tests/data/integritycheck/mimetypeListModified/core/signature.json
@@ -0,0 +1,7 @@
+{
+ "hashes": {
+ "core\/js\/mimetypelist.js": "b04161ccafa1fae9ce92393f9e293e70523a7cfde1ffd71ef980a287048fde559d2fd24575652220a821e61ca398b87caab96d533e210c7ee7f48a7cdfcf9bb7"
+ },
+ "signature": "sxNvTR6Y7xfMGFHsHTSYUtBHRtnWb+1ELf4zdgulFv\/4emGrmG2l+oZc+alHIMeBCgWHSrEDmgbtuJ0V6NJCD+yeoGhOJbkq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VzGv1rEJUrn5veP1\r\n0KmauAqtiIaYRm4f6YBsn0INcZxzIPZ0p8qFtVZBPeHhvQtvOt0iXI\/XUxEWOa2F\r\nK2EqhErgMK\/N07U1JJJay5tYZRtvkGq46oP\/5kQG8hYST0MDK6VihJoPpvCmAm4E\r\npEYKQ96x6A4EH9Y9mZlYozH\/eqmxPbTK8n89\/p7Ydun4rI+B2iiLnY8REWWy6+UQ\r\nV204fGUkJqW5CrKy3P3XvY9X\r\n-----END CERTIFICATE-----"
+} \ No newline at end of file
diff --git a/tests/lib/IntegrityCheck/CheckerTest.php b/tests/lib/IntegrityCheck/CheckerTest.php
index 6f0c8e8ae85..be9ecdd9041 100644
--- a/tests/lib/IntegrityCheck/CheckerTest.php
+++ b/tests/lib/IntegrityCheck/CheckerTest.php
@@ -21,6 +21,7 @@
namespace Test\IntegrityCheck;
+use OC\Core\Command\Maintenance\Mimetype\GenerateMimetypeFileBuilder;
use OC\IntegrityCheck\Checker;
use OC\IntegrityCheck\Helpers\AppLocator;
use OC\IntegrityCheck\Helpers\EnvironmentHelper;
@@ -764,7 +765,32 @@ class CheckerTest extends TestCase {
$this->assertSame([], $this->checker->verifyCoreSignature());
}
+ /**
+ * See inline instruction on how to update the test assets when changing mimetypealiases.dist.json
+ */
public function testVerifyCoreSignatureWithModifiedMimetypelistSignatureData() {
+ $shippedMimetypeAliases = (array)json_decode(file_get_contents(\OC::$SERVERROOT . '/resources/config/mimetypealiases.dist.json'));
+ $allAliases = array_merge($shippedMimetypeAliases, ['my-custom/mimetype' => 'custom']);
+
+ $this->mimeTypeDetector
+ ->method('getOnlyDefaultAliases')
+ ->willReturn($shippedMimetypeAliases);
+
+ $this->mimeTypeDetector
+ ->method('getAllAliases')
+ ->willReturn($allAliases);
+
+ $oldMimetypeList = new GenerateMimetypeFileBuilder();
+ $all = $this->mimeTypeDetector->getAllAliases();
+ $newFile = $oldMimetypeList->generateFile($all);
+
+ // When updating the mimetype list the test assets need to be updated as well
+ // 1. Update core/js/mimetypelist.js with the new generated js by running the test with the next line uncommented:
+ // file_put_contents(\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js', $newFile);
+ // 2. Update signature.json using the following occ command:
+ // occ integrity:sign-core --privateKey=./tests/data/integritycheck/core.key --certificate=./tests/data/integritycheck/core.crt --path=./tests/data/integritycheck/mimetypeListModified
+ self::assertEquals($newFile, file_get_contents(\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js'));
+
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -775,264 +801,18 @@ class CheckerTest extends TestCase {
->with('integrity.check.disabled', false)
->willReturn(false);
- $this->mimeTypeDetector
- ->expects($this->once())
- ->method('getOnlyDefaultAliases')
- ->willReturn(
- [
- '_comment' => 'Array of mimetype aliases.',
- '_comment2' => 'Any changes you make here will be overwritten on an update of Nextcloud.',
- '_comment3' => 'Put any custom mappings in a new file mimetypealiases.json in the config/ folder of Nextcloud',
- '_comment4' => 'After any change to mimetypealiases.json run:',
- '_comment5' => './occ maintenance:mimetype:update-js',
- '_comment6' => 'Otherwise your update won\'t propagate through the system.',
- 'application/coreldraw' => 'image',
- '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',
- '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.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',
- 'application/vnd.ms-excel.sheet.macroEnabled.12' => 'x-office/spreadsheet',
- 'application/vnd.ms-excel.template.macroEnabled.12' => 'x-office/spreadsheet',
- 'application/vnd.ms-fontobject' => 'image',
- 'application/vnd.ms-powerpoint' => 'x-office/presentation',
- 'application/vnd.ms-powerpoint.addin.macroEnabled.12' => 'x-office/presentation',
- 'application/vnd.ms-powerpoint.presentation.macroEnabled.12' => 'x-office/presentation',
- 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12' => 'x-office/presentation',
- 'application/vnd.ms-powerpoint.template.macroEnabled.12' => 'x-office/presentation',
- 'application/vnd.ms-visio.drawing.macroEnabled.12' => 'application/vnd.visio',
- 'application/vnd.ms-visio.drawing' => 'application/vnd.visio',
- 'application/vnd.ms-visio.stencil.macroEnabled.12' => 'application/vnd.visio',
- 'application/vnd.ms-visio.stencil' => 'application/vnd.visio',
- 'application/vnd.ms-visio.template.macroEnabled.12' => 'application/vnd.visio',
- 'application/vnd.ms-visio.template' => 'application/vnd.visio',
- 'application/vnd.ms-word.document.macroEnabled.12' => 'x-office/document',
- 'application/vnd.ms-word.template.macroEnabled.12' => 'x-office/document',
- 'application/vnd.oasis.opendocument.presentation' => 'x-office/presentation',
- 'application/vnd.oasis.opendocument.presentation-template' => 'x-office/presentation',
- 'application/vnd.oasis.opendocument.spreadsheet' => 'x-office/spreadsheet',
- 'application/vnd.oasis.opendocument.spreadsheet-template' => 'x-office/spreadsheet',
- 'application/vnd.oasis.opendocument.text' => 'x-office/document',
- 'application/vnd.oasis.opendocument.text-master' => 'x-office/document',
- 'application/vnd.oasis.opendocument.text-template' => 'x-office/document',
- 'application/vnd.oasis.opendocument.graphics' => 'x-office/drawing',
- 'application/vnd.oasis.opendocument.graphics-template' => 'x-office/drawing',
- 'application/vnd.oasis.opendocument.text-web' => 'x-office/document',
- 'application/vnd.oasis.opendocument.text-flat-xml' => 'x-office/document',
- 'application/vnd.oasis.opendocument.spreadsheet-flat-xml' => 'x-office/spreadsheet',
- 'application/vnd.oasis.opendocument.graphics-flat-xml' => 'x-office/drawing',
- 'application/vnd.oasis.opendocument.presentation-flat-xml' => 'x-office/presentation',
- 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'x-office/presentation',
- 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'x-office/presentation',
- 'application/vnd.openxmlformats-officedocument.presentationml.template' => 'x-office/presentation',
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'x-office/spreadsheet',
- '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-bzip2' => 'package/x-generic',
- 'application/x-cbr' => 'text',
- 'application/x-compressed' => 'package/x-generic',
- 'application/x-dcraw' => 'image',
- 'application/x-deb' => 'package/x-generic',
- 'application/x-fictionbook+xml' => 'text',
- 'application/x-font' => 'image',
- 'application/x-gimp' => 'image',
- 'application/x-gzip' => 'package/x-generic',
- 'application/x-iwork-keynote-sffkey' => 'x-office/presentation',
- 'application/x-iwork-numbers-sffnumbers' => 'x-office/spreadsheet',
- 'application/x-iwork-pages-sffpages' => 'x-office/document',
- 'application/x-mobipocket-ebook' => 'text',
- 'application/x-perl' => 'text/code',
- 'application/x-photoshop' => 'image',
- 'application/x-php' => 'text/code',
- 'application/x-rar-compressed' => 'package/x-generic',
- 'application/x-tar' => 'package/x-generic',
- 'application/x-tex' => 'text',
- 'application/xml' => 'text/html',
- 'application/yaml' => 'text/code',
- 'application/zip' => 'package/x-generic',
- 'database' => 'file',
- 'httpd/unix-directory' => 'dir',
- 'text/css' => 'text/code',
- 'text/csv' => 'x-office/spreadsheet',
- 'text/html' => 'text/code',
- 'text/x-c' => 'text/code',
- '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',
- 'application/internet-shortcut' => 'link',
- 'application/km' => 'mindmap',
- 'application/x-freemind' => 'mindmap',
- 'application/vnd.xmind.workbook' => 'mindmap'
- ]);
-
- $this->mimeTypeDetector
- ->expects($this->once())
- ->method('getAllAliases')
- ->willReturn(
- [
- '_comment' => 'Array of mimetype aliases.',
- '_comment2' => 'Any changes you make here will be overwritten on an update of Nextcloud.',
- '_comment3' => 'Put any custom mappings in a new file mimetypealiases.json in the config/ folder of Nextcloud',
- '_comment4' => 'After any change to mimetypealiases.json run:',
- '_comment5' => './occ maintenance:mimetype:update-js',
- '_comment6' => 'Otherwise your update won\'t propagate through the system.',
- 'application/coreldraw' => 'image',
- 'application/test' => 'image',
- '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',
- '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.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',
- 'application/vnd.ms-excel.sheet.macroEnabled.12' => 'x-office/spreadsheet',
- 'application/vnd.ms-excel.template.macroEnabled.12' => 'x-office/spreadsheet',
- 'application/vnd.ms-fontobject' => 'image',
- 'application/vnd.ms-powerpoint' => 'x-office/presentation',
- 'application/vnd.ms-powerpoint.addin.macroEnabled.12' => 'x-office/presentation',
- 'application/vnd.ms-powerpoint.presentation.macroEnabled.12' => 'x-office/presentation',
- 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12' => 'x-office/presentation',
- 'application/vnd.ms-powerpoint.template.macroEnabled.12' => 'x-office/presentation',
- 'application/vnd.ms-visio.drawing.macroEnabled.12' => 'application/vnd.visio',
- 'application/vnd.ms-visio.drawing' => 'application/vnd.visio',
- 'application/vnd.ms-visio.stencil.macroEnabled.12' => 'application/vnd.visio',
- 'application/vnd.ms-visio.stencil' => 'application/vnd.visio',
- 'application/vnd.ms-visio.template.macroEnabled.12' => 'application/vnd.visio',
- 'application/vnd.ms-visio.template' => 'application/vnd.visio',
- 'application/vnd.ms-word.document.macroEnabled.12' => 'x-office/document',
- 'application/vnd.ms-word.template.macroEnabled.12' => 'x-office/document',
- 'application/vnd.oasis.opendocument.presentation' => 'x-office/presentation',
- 'application/vnd.oasis.opendocument.presentation-template' => 'x-office/presentation',
- 'application/vnd.oasis.opendocument.spreadsheet' => 'x-office/spreadsheet',
- 'application/vnd.oasis.opendocument.spreadsheet-template' => 'x-office/spreadsheet',
- 'application/vnd.oasis.opendocument.text' => 'x-office/document',
- 'application/vnd.oasis.opendocument.text-master' => 'x-office/document',
- 'application/vnd.oasis.opendocument.text-template' => 'x-office/document',
- 'application/vnd.oasis.opendocument.graphics' => 'x-office/drawing',
- 'application/vnd.oasis.opendocument.graphics-template' => 'x-office/drawing',
- 'application/vnd.oasis.opendocument.text-web' => 'x-office/document',
- 'application/vnd.oasis.opendocument.text-flat-xml' => 'x-office/document',
- 'application/vnd.oasis.opendocument.spreadsheet-flat-xml' => 'x-office/spreadsheet',
- 'application/vnd.oasis.opendocument.graphics-flat-xml' => 'x-office/drawing',
- 'application/vnd.oasis.opendocument.presentation-flat-xml' => 'x-office/presentation',
- 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'x-office/presentation',
- 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'x-office/presentation',
- 'application/vnd.openxmlformats-officedocument.presentationml.template' => 'x-office/presentation',
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'x-office/spreadsheet',
- '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-bzip2' => 'package/x-generic',
- 'application/x-cbr' => 'text',
- 'application/x-compressed' => 'package/x-generic',
- 'application/x-dcraw' => 'image',
- 'application/x-deb' => 'package/x-generic',
- 'application/x-fictionbook+xml' => 'text',
- 'application/x-font' => 'image',
- 'application/x-gimp' => 'image',
- 'application/x-gzip' => 'package/x-generic',
- 'application/x-iwork-keynote-sffkey' => 'x-office/presentation',
- 'application/x-iwork-numbers-sffnumbers' => 'x-office/spreadsheet',
- 'application/x-iwork-pages-sffpages' => 'x-office/document',
- 'application/x-mobipocket-ebook' => 'text',
- 'application/x-perl' => 'text/code',
- 'application/x-photoshop' => 'image',
- 'application/x-php' => 'text/code',
- 'application/x-rar-compressed' => 'package/x-generic',
- 'application/x-tar' => 'package/x-generic',
- 'application/x-tex' => 'text',
- 'application/xml' => 'text/html',
- 'application/yaml' => 'text/code',
- 'application/zip' => 'package/x-generic',
- 'database' => 'file',
- 'httpd/unix-directory' => 'dir',
- 'text/css' => 'text/code',
- 'text/csv' => 'x-office/spreadsheet',
- 'text/html' => 'text/code',
- 'text/x-c' => 'text/code',
- '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',
- 'application/internet-shortcut' => 'link',
- 'application/km' => 'mindmap',
- 'application/x-freemind' => 'mindmap',
- 'application/vnd.xmind.workbook' => 'mindmap'
- ]);
-
$this->environmentHelper
->expects($this->any())
->method('getServerRoot')
->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified');
- $signatureDataFile = '{
- "hashes": {
- "core\/js\/mimetypelist.js": "94195a260a005dac543c3f6aa504f1b28e0078297fe94a4f52f012c16c109f0323eecc9f767d6949f860dfe454625fcaf1dc56f87bb8350975d8f006bbbdf14a"
- },
- "signature": "BYPMrU+2vzSOOjSFcRPsWphv0uXQ+Vu6yC7FL6V0iM4WXcAkTK1e5OjkHFqUBNIDxg0AWB14ogUFRGDr+Qh+AqDRaX1u2ST2BhO1mgVh4JaqVOhlnDgWg8NPRMaVqvMy6Rfmyj57D1vmDmbVGQmnaIxEot84mOx4MP6sgZIVOMEe2itlmNwp1ogG6t61wpj4dFe73tYPDePWh0j+TmW8a\/Ry67wIhWHHhSGWIhhYRi8NmfW0oLhL1tgze5+Oo4pvgIgJq47BOYGu4YnfY3w8PB\/sQ5bPIvd\/+CTt\/1RASoadEfLd0MjLFEVEAj3uVGMq1kv7gK4bisXrKJS\/dbCwM+iJQfVFIVjwzuPH1QLbvSEsVUkJKVM4iS4aKiIty5Q760ufuSkZUoZoBrJCy\/PfC6Dc9hmOg1gXiPA9Tzje7L\/V8b0ULmFdnZtITYjEXd52yhfB\/P6qsKOm3HM8bM\/qoL3ra7\/hwe\/dyEi45eJbrbw9lywWwK8Q+fY92o2PCQgVkPYgK0VUOxPMZ6CtBM5OOe9lku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rcecgXwDizwnn0C\/aKc\r\nbDIjujpL1s9HO05pcD\/V3wKcPZ1izymBkmMyIbL52iRVN5FTVHeZdXPpFuq+CTQJ\r\nQ238lC+A\/KOVAgMBAAEwDQYJKoZIhvcNAQEFBQADggIBAGoKTnh8RfJV4sQItVC2\r\nAvfJagkrIqZ3iiQTUBQGTKBsTnAqE1H7QgUSV9vSd+8rgvHkyZsRjmtyR1e3A6Ji\r\noNCXUbExC\/0iCPUqdHZIVb+Lc\/vWuv4ByFMybGPydgtLoEUX2ZrKFWmcgZFDUSRd\r\n9Uj26vtUhCC4bU4jgu6hIrR9IuxOBLQUxGTRZyAcXvj7obqRAEZwFAKQgFpfpqTb\r\nH+kjcbZSaAlLVSF7vBc1syyI8RGYbqpwvtREqJtl5IEIwe6huEqJ3zPnlP2th\/55\r\ncf3Fovj6JJgbb9XFxrdnsOsDOu\/tpnaRWlvv5ib4+SzG5wWFT5UUEo4Wg2STQiiX\r\nuVSRQxK1LE1yg84bs3NZk9FSQh4B8vZVuRr5FaJsZZkwlFlhRO\/\/+TJtXRbyNgsf\r\noMRZGi8DLGU2SGEAHcRH\/QZHq\/XDUWVzdxrSBYcy7GSpT7UDVzGv1rEJUrn5veP1\r\n0KmauAqtiIaYRm4f6YBsn0INcZxzIPZ0p8qFtVZBPeHhvQtvOt0iXI\/XUxEWOa2F\r\nK2EqhErgMK\/N07U1JJJay5tYZRtvkGq46oP\/5kQG8hYST0MDK6VihJoPpvCmAm4E\r\npEYKQ96x6A4EH9Y9mZlYozH\/eqmxPbTK8n89\/p7Ydun4rI+B2iiLnY8REWWy6+UQ\r\nV204fGUkJqW5CrKy3P3XvY9X\r\n-----END CERTIFICATE-----"
-}';
- $this->fileAccessHelper
- ->expects($this->at(0))
- ->method('file_get_contents')
- ->with(
- \OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/core/signature.json'
- )
- ->willReturn($signatureDataFile);
+
+ $signatureDataFile = file_get_contents(__DIR__ .'/../../data/integritycheck/mimetypeListModified/core/signature.json');
$this->fileAccessHelper
- ->expects($this->at(1))
->method('file_get_contents')
- ->with(
- \OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/resources/codesigning/root.crt'
- )
- ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'));
+ ->willReturnMap([
+ [\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/core/signature.json', $signatureDataFile],
+ [\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/resources/codesigning/root.crt', file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')],
+ ]);
$this->assertSame([], $this->checker->verifyCoreSignature());
}
diff --git a/version.php b/version.php
index ee6b872345a..73910f1460d 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/patchlevel
// when updating major/minor version number.
-$OC_Version = [25, 0, 0, 1];
+$OC_Version = [25, 0, 0, 2];
// The human readable string
$OC_VersionString = '25.0.0 dev';