Index: trunk/phase3/includes/upload/UploadBase.php |
— | — | @@ -305,15 +305,16 @@ |
306 | 306 | global $wgVerifyMimeType; |
307 | 307 | if ( $wgVerifyMimeType ) { |
308 | 308 | wfDebug ( "\n\nmime: <$mime> extension: <{$this->mFinalExtension}>\n\n"); |
309 | | - if ( !$this->verifyExtension( $mime, $this->mFinalExtension ) ) { |
310 | | - return array( 'filetype-mime-mismatch' ); |
311 | | - } |
312 | | - |
313 | 309 | global $wgMimeTypeBlacklist; |
314 | 310 | if ( $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) { |
315 | 311 | return array( 'filetype-badmime', $mime ); |
316 | 312 | } |
317 | 313 | |
| 314 | + # XXX: Missing extension will be caught by validateName() via getTitle() |
| 315 | + if ( $this->mFinalExtension != '' && !$this->verifyExtension( $mime, $this->mFinalExtension ) ) { |
| 316 | + return array( 'filetype-mime-mismatch' ); |
| 317 | + } |
| 318 | + |
318 | 319 | # Check IE type |
319 | 320 | $fp = fopen( $this->mTempPath, 'rb' ); |
320 | 321 | $chunk = fread( $fp, 256 ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -101,6 +101,8 @@ |
102 | 102 | * (bug 26781) {{PAGENAME}} and related parser functions escape their output better. |
103 | 103 | * (bug 26716) Provide link to instructions for external editor related preferences |
104 | 104 | and add a comment to the ini control file explaining what is going on. |
| 105 | +* Trying to upload a file with no extension or with a disallowed MIME type now gives |
| 106 | + the right message instead of complaining about a MIME/extension mismatch |
105 | 107 | |
106 | 108 | === API changes in 1.18 === |
107 | 109 | * (bug 26339) Throw warning when truncating an overlarge API result |