From: Aryeh Gregor Date: Tue, 22 May 2007 03:12:18 +0000 (+0000) Subject: Don't call static functions non-statically either. Also, remove redundant @access... X-Git-Tag: 1.31.0-rc.0~52830 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=7ed5398bdfef0807d4431b7e26526a0082ad7ad0;p=lhc%2Fweb%2Fwiklou.git Don't call static functions non-statically either. Also, remove redundant @access, and add type hinting. --- diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index a3a134eba9..e3707f13de 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -1285,7 +1285,7 @@ class UploadForm { if( $img->exists() ) { global $wgUser, $wgOut; if( $img->isLocal() ) { - if( !$this->userCanReUpload( $wgUser, $img->name ) ) { + if( !self::userCanReUpload( $wgUser, $img->name ) ) { $error = 'fileexists-forbidden'; } } else { @@ -1304,19 +1304,18 @@ class UploadForm { // Rockin', go ahead and upload return true; } - + /** * Check if a user is the last uploader * * @param User $user * @param string $img, image name * @return bool - * @access public */ - public static function userCanReUpload( $user, $img ) { - if( $user->isAllowed('reupload' ) ) + public static function userCanReUpload( User $user, $img ) { + if( $user->isAllowed( 'reupload' ) ) return true; // non-conditional - if( !$user->isAllowed('reupload-own') ) + if( !$user->isAllowed( 'reupload-own' ) ) return false; $dbr = wfGetDB( DB_SLAVE );