r46483 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46482‎ | r46483 | r46484 >
Date:20:17, 28 January 2009
Author:aaron
Status:resolved
Tags:
Comment:
Split off 'wpReUpload' into the old check 'wpReUpload' and the bool 'wpForReUpload' to avoid breakage.
Modified paths:
  • /trunk/phase3/includes/ImagePage.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImagePage.php
@@ -557,7 +557,7 @@
558558 public function getUploadUrl() {
559559 $this->loadFile();
560560 $uploadTitle = SpecialPage::getTitleFor( 'Upload' );
561 - return $uploadTitle->getFullUrl( 'wpDestFile=' . urlencode( $this->img->getName() ) . '&wpReUpload=1' );
 561+ return $uploadTitle->getFullUrl( 'wpDestFile=' . urlencode( $this->img->getName() ) . '&wpForReUpload=1' );
562562 }
563563
564564 /**
Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -62,6 +62,7 @@
6363 $this->mDesiredDestName = $request->getText( 'wpDestFile' );
6464 $this->mIgnoreWarning = $request->getCheck( 'wpIgnoreWarning' );
6565 $this->mComment = $request->getText( 'wpUploadDescription' );
 66+ $this->mForReUpload = $request->getBool( 'wpForReUpload' );
6667 $this->mReUpload = $request->getCheck( 'wpReUpload' );
6768
6869 if( !$request->wasPosted() ) {
@@ -73,8 +74,6 @@
7475 # Placeholders for text injection by hooks (empty per default)
7576 $this->uploadFormTextTop = "";
7677 $this->uploadFormTextAfterSummary = "";
77 -
78 - $this->mReUpload = $request->getCheck( 'wpReUpload' );
7978 $this->mUploadClicked = $request->getCheck( 'wpUpload' );
8079
8180 $this->mLicense = $request->getText( 'wpLicense' );
@@ -566,7 +565,7 @@
567566 * Try actually saving the thing...
568567 * It will show an error form on failure.
569568 */
570 - if( !$this->mReUpload ) {
 569+ if( !$this->mForReUpload ) {
571570 $pageText = self::getInitialPageText( $this->mComment, $this->mLicense,
572571 $this->mCopyrightStatus, $this->mCopyrightSource );
573572 }
@@ -770,7 +769,7 @@
771770 $title = $file->getTitle();
772771 # Don't throw the warning when the titles are the same, it's a reupload
773772 # and highly redundant.
774 - if ( !$title->equals( $destinationTitle ) || !$this->mReUpload ) {
 773+ if ( !$title->equals( $destinationTitle ) || !$this->mForReUpload ) {
775774 $msg .= $title->getPrefixedText() .
776775 "|" . $title->getText() . "\n";
777776 }
@@ -1070,7 +1069,7 @@
10711070 $sourcefilename = wfMsgExt( 'sourcefilename', array( 'parseinline', 'escapenoentities' ) );
10721071 $destfilename = wfMsgExt( 'destfilename', array( 'parseinline', 'escapenoentities' ) );
10731072
1074 - $msg = $this->mReUpload ? 'filereuploadsummary' : 'fileuploadsummary';
 1073+ $msg = $this->mForReUpload ? 'filereuploadsummary' : 'fileuploadsummary';
10751074 $summary = wfMsgExt( $msg, 'parseinline' );
10761075
10771076 $licenses = new Licenses();
@@ -1087,7 +1086,7 @@
10881087
10891088 $watchChecked = $this->watchCheck() ? 'checked="checked"' : '';
10901089 # Re-uploads should not need "file exist already" warnings
1091 - $warningChecked = ($this->mIgnoreWarning || $this->mReUpload) ? 'checked="checked"' : '';
 1090+ $warningChecked = ($this->mIgnoreWarning || $this->mForReUpload) ? 'checked="checked"' : '';
10921091
10931092 // Prepare form for upload or upload/copy
10941093 if( $wgAllowCopyUploads && $wgUser->isAllowed( 'upload_by_url' ) ) {
@@ -1123,7 +1122,7 @@
11241123 $destOnkeyup = '';
11251124 }
11261125 # Uploading a new version? If so, the name is fixed.
1127 - $on = $this->mReUpload ? "readonly='readonly'" : "";
 1126+ $on = $this->mForReUpload ? "readonly='readonly'" : "";
11281127
11291128 $encComment = htmlspecialchars( $this->mComment );
11301129
@@ -1171,7 +1170,7 @@
11721171 <tr>"
11731172 );
11741173 # Re-uploads should not need license info
1175 - if ( !$this->mReUpload && $licenseshtml != '' ) {
 1174+ if ( !$this->mForReUpload && $licenseshtml != '' ) {
11761175 global $wgStylePath;
11771176 $wgOut->addHTML( "
11781177 <td class='mw-label'>
@@ -1197,7 +1196,7 @@
11981197 }
11991198 }
12001199
1201 - if ( !$this->mReUpload && $wgUseCopyrightUpload ) {
 1200+ if ( !$this->mForReUpload && $wgUseCopyrightUpload ) {
12021201 $filestatus = wfMsgExt( 'filestatus', 'escapenoentities' );
12031202 $copystatus = htmlspecialchars( $this->mCopyrightStatus );
12041203 $filesource = wfMsgExt( 'filesource', 'escapenoentities' );
@@ -1250,7 +1249,7 @@
12511250 </tr>" .
12521251 Xml::closeElement( 'table' ) .
12531252 Xml::hidden( 'wpDestFileWarningAck', '', array( 'id' => 'wpDestFileWarningAck' ) ) .
1254 - xml::hidden( 'wpReUpload', $this->mReUpload ) .
 1253+ Xml::hidden( 'wpForReUpload', $this->mForReUpload ) .
12551254 Xml::closeElement( 'fieldset' ) .
12561255 Xml::closeElement( 'form' )
12571256 );

Status & tagging log