Merge "Follow-up 42333412833a - Fix behaviour $wgVerifyMimeType = false;"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 30 Jul 2013 08:52:13 +0000 (08:52 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 30 Jul 2013 08:52:13 +0000 (08:52 +0000)
1  2 
includes/upload/UploadBase.php

@@@ -410,10 -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__ );
  
                if ( $status->isGood() ) {
                        if ( $watch ) {
 -                              $user->addWatch( $this->getLocalFile()->getTitle() );
 +                              WatchAction::doWatch( $this->getLocalFile()->getTitle(), $user, WatchedItem::IGNORE_USER_RIGHTS );
                        }
                        wfRunHooks( 'UploadComplete', array( &$this ) );
                }