Merge pull request #3444 from nextcloud/recognize-bat-and-cmd

Recognize .bat and .cmd files
This commit is contained in:
Morris Jobke 2017-02-13 18:09:12 -06:00 committed by GitHub
commit 69c9ca4522
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';