r84762 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84761‎ | r84762 | r84763 >
Date:20:42, 25 March 2011
Author:neilk
Status:ok
Tags:
Comment:
don't check title permissions if upload is destined for stash anyway
Modified paths:
  • /trunk/phase3/includes/api/ApiUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiUpload.php
@@ -82,11 +82,15 @@
8383 // Check if the uploaded file is sane
8484 $this->verifyUpload();
8585
86 - // Check permission to upload this file
87 - $permErrors = $this->mUpload->verifyTitlePermissions( $wgUser );
88 - if ( $permErrors !== true ) {
89 - // TODO: stash the upload and allow choosing a new name
90 - $this->dieUsageMsg( array( 'badaccess-groups' ) );
 86+ // Check if the user has the rights to modify or overwrite the requested title
 87+ // (This check is irrelevant if stashing is already requested, since the errors
 88+ // can always be fixed by changing the title)
 89+ if ( ! $this->mParams['stash'] ) {
 90+ $permErrors = $this->mUpload->verifyTitlePermissions( $wgUser );
 91+ if ( $permErrors !== true ) {
 92+ // TODO: stash the upload and allow choosing a new name
 93+ $this->dieUsageMsg( array( 'badaccess-groups' ) );
 94+ }
9195 }
9296
9397 // Prepare the API result

Follow-up revisions

RevisionCommit summaryAuthorDate
r850001.17wmf1: MFT changes for UploadWizard deployment: r78426, r81393, r81401, r8...catrope08:20, 30 March 2011

Status & tagging log