Follow-up 42333412833a - Fix behaviour $wgVerifyMimeType = false;
authorBrian Wolff <bawolff+wn@gmail.com>
Mon, 17 Jun 2013 22:48:01 +0000 (19:48 -0300)
committerBrian Wolff <bawolff+wn@gmail.com>
Sat, 6 Jul 2013 16:02:19 +0000 (16:02 +0000)
Should probably be backported to stable.

Bug: 49717
Change-Id: If1d6e8fed575bf2816a10db066ec4e023460ee1e

includes/upload/UploadBase.php

index 2ed20c5..710a501 100644 (file)
@@ -410,10 +410,10 @@ abstract class UploadBase {
                        return $status;
                }
 
-               if ( $wgVerifyMimeType ) {
-                       $this->mFileProps = FSFile::getPropsFromPath( $this->mTempPath, $this->mFinalExtension );
-                       $mime = $this->mFileProps['file-mime'];
+               $this->mFileProps = FSFile::getPropsFromPath( $this->mTempPath, $this->mFinalExtension );
+               $mime = $this->mFileProps['file-mime'];
 
+               if ( $wgVerifyMimeType ) {
                        # XXX: Missing extension will be caught by validateName() via getTitle()
                        if ( $this->mFinalExtension != '' && !$this->verifyExtension( $mime, $this->mFinalExtension ) ) {
                                wfProfileOut( __METHOD__ );