From: Sam Reed Date: Thu, 25 Mar 2010 21:03:49 +0000 (+0000) Subject: Minor tweak to performUpload in UploadBase.php X-Git-Tag: 1.31.0-rc.0~37357 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=3c010d143e3041f19c85609a78d000a92814f091;p=lhc%2Fweb%2Fwiklou.git Minor tweak to performUpload in UploadBase.php Only do one call to $status->isGood() and nest if $watch check in that --- diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 8e0f7a3ad7..94fda9b075 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -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 ) ); }