Minor tweak to performUpload in UploadBase.php
authorSam Reed <reedy@users.mediawiki.org>
Thu, 25 Mar 2010 21:03:49 +0000 (21:03 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 25 Mar 2010 21:03:49 +0000 (21:03 +0000)
Only do one call to $status->isGood() and nest if $watch check in that

includes/upload/UploadBase.php

index 8e0f7a3..94fda9b 100644 (file)
@@ -390,11 +390,11 @@ abstract class UploadBase {
                $status = $this->getLocalFile()->upload( $this->mTempPath, $comment, $pageText,
                        File::DELETE_SOURCE, $this->mFileProps, false, $user );
 
-               if( $status->isGood() && $watch ) {
-                       $user->addWatch( $this->getLocalFile()->getTitle() );
-               }
-
                if( $status->isGood() ) {
+                       if ( $watch ) {
+                               $user->addWatch( $this->getLocalFile()->getTitle() );
+                       }
+
                        wfRunHooks( 'UploadComplete', array( &$this ) );
                }