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 {
// 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 );