Recognize .bat and .cmd files

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-02-10 14:25:25 +01:00
parent b4ade76665
commit ade91c8fe2
No known key found for this signature in database
GPG key ID: E166FD8976B3BAC8
3 changed files with 20 additions and 3 deletions

View file

@ -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');
}
}
}

View file

@ -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"],

View file

@ -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';