Index: branches/wmf-deployment/includes/upload/UploadBase.php |
— | — | @@ -915,14 +915,18 @@ |
916 | 916 | global $wgUser; |
917 | 917 | // First check whether the local file can be overwritten |
918 | 918 | $file = $this->getLocalFile(); |
919 | | - if( $file->exists() ) |
| 919 | + if( $file->exists() ) { |
920 | 920 | if( !self::userCanReUpload( $wgUser, $file ) ) |
921 | 921 | return 'fileexists-forbidden'; |
| 922 | + else |
| 923 | + return true; |
| 924 | + } |
922 | 925 | |
923 | | - // Check shared conflicts |
924 | | - $file = wfFindFile( $file->getName() ); |
925 | | - if ( $file && ( !$wgUser->isAllowed( 'reupload' ) || |
926 | | - !$wgUser->isAllowed( 'reupload-shared' ) ) ) |
| 926 | + /* Check shared conflicts: if the local file does not exist, but |
| 927 | + * wfFindFile finds a file, it exists in a shared repository. |
| 928 | + */ |
| 929 | + $file = wfFindFile( $this->getTitle() ); |
| 930 | + if ( $file && !$wgUser->isAllowed( 'reupload-shared' ) ) |
927 | 931 | return 'fileexists-shared-forbidden'; |
928 | 932 | |
929 | 933 | return true; |
Property changes on: branches/wmf-deployment/includes/upload/UploadBase.php |
___________________________________________________________________ |
Name: svn:mergeinfo |
930 | 934 | - /branches/REL1_15/phase3/includes/upload/UploadBase.php:51646 |
/branches/wmf-deployment/includes/upload/UploadBase.php:53381 |
/trunk/phase3/includes/upload/UploadBase.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56416,56618 |
931 | 935 | + /branches/REL1_15/phase3/includes/upload/UploadBase.php:51646 |
/branches/wmf-deployment/includes/upload/UploadBase.php:53381 |
/trunk/phase3/includes/upload/UploadBase.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56416,56618,56631 |