Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1203,6 +1203,7 @@ |
1204 | 1204 | 'minlength1', |
1205 | 1205 | 'illegalfilename', |
1206 | 1206 | 'badfilename', |
| 1207 | + 'filetype-mime-mismatch', |
1207 | 1208 | 'filetype-badmime', |
1208 | 1209 | 'filetype-bad-ie-mime', |
1209 | 1210 | 'filetype-unwanted-type', |
Index: trunk/phase3/includes/upload/UploadBase.php |
— | — | @@ -239,6 +239,11 @@ |
240 | 240 | # check mime type, if desired |
241 | 241 | global $wgVerifyMimeType; |
242 | 242 | if ( $wgVerifyMimeType ) { |
| 243 | + wfDebug ( "\n\nmime: <$mime> extension: <{$this->mFinalExtension}>\n\n"); |
| 244 | + if ( !$this->verifyExtension( $mime, $this->mFinalExtension ) ) { |
| 245 | + return array( 'filetype-mime-mismatch' ); |
| 246 | + } |
| 247 | + |
243 | 248 | global $wgMimeTypeBlacklist; |
244 | 249 | if ( $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) { |
245 | 250 | return array( 'filetype-badmime', $mime ); |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2040,6 +2040,7 @@ |
2041 | 2041 | 'illegalfilename' => 'The filename "$1" contains characters that are not allowed in page titles. |
2042 | 2042 | Please rename the file and try uploading it again.', |
2043 | 2043 | 'badfilename' => 'File name has been changed to "$1".', |
| 2044 | +'filetype-mime-mismatch' => 'File extension does not match MIME type.', |
2044 | 2045 | 'filetype-badmime' => 'Files of the MIME type "$1" are not allowed to be uploaded.', |
2045 | 2046 | '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.', |
2046 | 2047 | 'filetype-unwanted-type' => "'''\".\$1\"''' is an unwanted file type. |