# check mime type, if desired
global $wgVerifyMimeType;
if ( $wgVerifyMimeType ) {
+ wfDebug ( "\n\nmime: <$mime> extension: <{$this->mFinalExtension}>\n\n");
+ if ( !$this->verifyExtension( $mime, $this->mFinalExtension ) ) {
+ return array( 'filetype-mime-mismatch' );
+ }
+
global $wgMimeTypeBlacklist;
if ( $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) {
return array( 'filetype-badmime', $mime );
'illegalfilename' => 'The filename "$1" contains characters that are not allowed in page titles.
Please rename the file and try uploading it again.',
'badfilename' => 'File name has been changed to "$1".',
+'filetype-mime-mismatch' => 'File extension does not match MIME type.',
'filetype-badmime' => 'Files of the MIME type "$1" are not allowed to be uploaded.',
'filetype-bad-ie-mime' => 'Cannot upload this file because Internet Explorer would detect it as "$1", which is a disallowed and potentially dangerous file type.',
'filetype-unwanted-type' => "'''\".\$1\"''' is an unwanted file type.
'minlength1',
'illegalfilename',
'badfilename',
+ 'filetype-mime-mismatch',
'filetype-badmime',
'filetype-bad-ie-mime',
'filetype-unwanted-type',