r56734 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56733‎ | r56734 | r56735 >
Date:21:01, 21 September 2009
Author:werdna
Status:ok
Tags:
Comment:
Merge r56631, fix for bug 20677.
Note that r56639 and r56640 might also need merging, which are marked as follow-ups, but seem to be unrelated to this revision as far as I can see.
Modified paths:
  • /branches/wmf-deployment/includes/upload/UploadBase.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/includes/upload/UploadBase.php
@@ -915,14 +915,18 @@
916916 global $wgUser;
917917 // First check whether the local file can be overwritten
918918 $file = $this->getLocalFile();
919 - if( $file->exists() )
 919+ if( $file->exists() ) {
920920 if( !self::userCanReUpload( $wgUser, $file ) )
921921 return 'fileexists-forbidden';
 922+ else
 923+ return true;
 924+ }
922925
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' ) )
927931 return 'fileexists-shared-forbidden';
928932
929933 return true;
Property changes on: branches/wmf-deployment/includes/upload/UploadBase.php
___________________________________________________________________
Name: svn:mergeinfo
930934 - /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
931935 + /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

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56631Fix overwrite permission checking for users without reupload-shared right.btongminh09:01, 19 September 2009
r56639Fix several messages generated by SpecialUpload::getExistsWarning which were ...btongminh15:42, 19 September 2009
r56640Follow up to r56639: Remove some existence check duplication and fix ApiUploa...btongminh15:49, 19 September 2009

Status & tagging log