Don't call static functions non-statically either. Also, remove redundant @access...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 22 May 2007 03:12:18 +0000 (03:12 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 22 May 2007 03:12:18 +0000 (03:12 +0000)
includes/SpecialUpload.php

index a3a134e..e3707f1 100644 (file)
@@ -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 );