From ade91c8fe2e9230dea62cbf47a19cd5907646864 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 10 Feb 2017 14:25:25 +0100 Subject: [PATCH] Recognize .bat and .cmd files Signed-off-by: Joas Schilling --- lib/private/Repair/RepairMimeTypes.php | 14 ++++++++++++++ resources/config/mimetypemapping.dist.json | 7 +++++-- version.php | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index 86427af4c4..fbf446a681 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -308,6 +308,16 @@ class RepairMimeTypes implements IRepairStep { self::updateMimetypes($updatedMimetypes); } + private function introduceWindowsProgramTypes() { + $updatedMimetypes = array( + 'htaccess' => 'text/plain', + 'bat' => 'application/x-msdos-program', + 'cmd' => 'application/cmd', + ); + + $this->updateMimetypes($updatedMimetypes); + } + /** * Fix mime types */ @@ -377,5 +387,9 @@ class RepairMimeTypes implements IRepairStep { $out->info('Fixed richdocuments additional office mime types'); } } + + if (version_compare($ocVersionFromBeforeUpdate, '12.0.0.13', '<') && $this->introduceWindowsProgramTypes()) { + $out->info('Fixed windows program mime types'); + } } } diff --git a/resources/config/mimetypemapping.dist.json b/resources/config/mimetypemapping.dist.json index 99638b6c02..2b187a6ac8 100644 --- a/resources/config/mimetypemapping.dist.json +++ b/resources/config/mimetypemapping.dist.json @@ -1,7 +1,7 @@ { - "_comment" : "Array mapping file extensions to mimetypes (in alphabetical order]", + "_comment" : "Array mapping file extensions to mimetypes (in alphabetical order)", "_comment2": "The first index in the mime type array is the assumed correct mimetype", - "_comment3": "and the second (if present] is a secure alternative", + "_comment3": "and the second (if present) is a secure alternative", "_comment4": "Any changes you make here will be overwritten on an update of Nextcloud", "_comment5": "Put any custom mappings in a new file mimetypemapping.json in the config/ folder of Nextcloud", @@ -15,6 +15,7 @@ "arw": ["image/x-dcraw"], "avi": ["video/x-msvideo"], "bash": ["text/x-shellscript"], + "bat": ["application/x-msdos-program"], "blend": ["application/x-blender"], "bin": ["application/x-bin"], "bmp": ["image/bmp"], @@ -29,6 +30,7 @@ "cc": ["text/x-c"], "cdr": ["application/coreldraw"], "class": ["application/java"], + "cmd": ["application/cmd"], "cnf": ["text/plain"], "conf": ["text/plain"], "cpp": ["text/x-c++src"], @@ -61,6 +63,7 @@ "h": ["text/x-h"], "hh": ["text/x-h"], "hpp": ["text/x-h"], + "htaccess": ["text/plain"], "html": ["text/html", "text/plain"], "htm": ["text/html", "text/plain"], "ical": ["text/calendar"], diff --git a/version.php b/version.php index 3d8abb5f2f..a556a9f729 100644 --- a/version.php +++ b/version.php @@ -26,7 +26,7 @@ // between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel // when updating major/minor version number. -$OC_Version = array(12, 0, 0, 12); +$OC_Version = array(12, 0, 0, 13); // The human readable string $OC_VersionString = '12.0 alpha';