follow up r53282
authorMark A. Hershberger <mah@users.mediawiki.org>
Mon, 22 Feb 2010 03:07:28 +0000 (03:07 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Mon, 22 Feb 2010 03:07:28 +0000 (03:07 +0000)
Recover the use of verifyExtension that was lost in r53282

includes/upload/UploadBase.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index ce4b66b..5d955b3 100644 (file)
@@ -239,6 +239,11 @@ abstract class UploadBase {
                # 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 );
index ea64f7e..dc1d6a6 100644 (file)
@@ -2040,6 +2040,7 @@ See the [[Special:NewFiles|gallery of new files]] for a more visual overview.',
 '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.
index 098fbe4..3ffc2f2 100644 (file)
@@ -1203,6 +1203,7 @@ $wgMessageStructure = array(
                'minlength1',
                'illegalfilename',
                'badfilename',
+               'filetype-mime-mismatch',
                'filetype-badmime',
                'filetype-bad-ie-mime',
                'filetype-unwanted-type',