From dc046d3632615337f48a74c8633d8dfb4362ffda Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 28 Jan 2009 20:17:11 +0000 Subject: [PATCH] Split off 'wpReUpload' into the old check 'wpReUpload' and the bool 'wpForReUpload' to avoid breakage. --- includes/ImagePage.php | 2 +- includes/specials/SpecialUpload.php | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index e70e11160b..1aba85e471 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -557,7 +557,7 @@ EOT public function getUploadUrl() { $this->loadFile(); $uploadTitle = SpecialPage::getTitleFor( 'Upload' ); - return $uploadTitle->getFullUrl( 'wpDestFile=' . urlencode( $this->img->getName() ) . '&wpReUpload=1' ); + return $uploadTitle->getFullUrl( 'wpDestFile=' . urlencode( $this->img->getName() ) . '&wpForReUpload=1' ); } /** diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index ee11ce4f1a..6268e4f2b0 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -62,6 +62,7 @@ class UploadForm { $this->mDesiredDestName = $request->getText( 'wpDestFile' ); $this->mIgnoreWarning = $request->getCheck( 'wpIgnoreWarning' ); $this->mComment = $request->getText( 'wpUploadDescription' ); + $this->mForReUpload = $request->getBool( 'wpForReUpload' ); $this->mReUpload = $request->getCheck( 'wpReUpload' ); if( !$request->wasPosted() ) { @@ -73,8 +74,6 @@ class UploadForm { # Placeholders for text injection by hooks (empty per default) $this->uploadFormTextTop = ""; $this->uploadFormTextAfterSummary = ""; - - $this->mReUpload = $request->getCheck( 'wpReUpload' ); $this->mUploadClicked = $request->getCheck( 'wpUpload' ); $this->mLicense = $request->getText( 'wpLicense' ); @@ -566,7 +565,7 @@ class UploadForm { * Try actually saving the thing... * It will show an error form on failure. */ - if( !$this->mReUpload ) { + if( !$this->mForReUpload ) { $pageText = self::getInitialPageText( $this->mComment, $this->mLicense, $this->mCopyrightStatus, $this->mCopyrightSource ); } @@ -770,7 +769,7 @@ class UploadForm { $title = $file->getTitle(); # Don't throw the warning when the titles are the same, it's a reupload # and highly redundant. - if ( !$title->equals( $destinationTitle ) || !$this->mReUpload ) { + if ( !$title->equals( $destinationTitle ) || !$this->mForReUpload ) { $msg .= $title->getPrefixedText() . "|" . $title->getText() . "\n"; } @@ -1070,7 +1069,7 @@ wgUploadAutoFill = {$autofill}; $sourcefilename = wfMsgExt( 'sourcefilename', array( 'parseinline', 'escapenoentities' ) ); $destfilename = wfMsgExt( 'destfilename', array( 'parseinline', 'escapenoentities' ) ); - $msg = $this->mReUpload ? 'filereuploadsummary' : 'fileuploadsummary'; + $msg = $this->mForReUpload ? 'filereuploadsummary' : 'fileuploadsummary'; $summary = wfMsgExt( $msg, 'parseinline' ); $licenses = new Licenses(); @@ -1087,7 +1086,7 @@ wgUploadAutoFill = {$autofill}; $watchChecked = $this->watchCheck() ? 'checked="checked"' : ''; # Re-uploads should not need "file exist already" warnings - $warningChecked = ($this->mIgnoreWarning || $this->mReUpload) ? 'checked="checked"' : ''; + $warningChecked = ($this->mIgnoreWarning || $this->mForReUpload) ? 'checked="checked"' : ''; // Prepare form for upload or upload/copy if( $wgAllowCopyUploads && $wgUser->isAllowed( 'upload_by_url' ) ) { @@ -1123,7 +1122,7 @@ wgUploadAutoFill = {$autofill}; $destOnkeyup = ''; } # Uploading a new version? If so, the name is fixed. - $on = $this->mReUpload ? "readonly='readonly'" : ""; + $on = $this->mForReUpload ? "readonly='readonly'" : ""; $encComment = htmlspecialchars( $this->mComment ); @@ -1171,7 +1170,7 @@ wgUploadAutoFill = {$autofill}; " ); # Re-uploads should not need license info - if ( !$this->mReUpload && $licenseshtml != '' ) { + if ( !$this->mForReUpload && $licenseshtml != '' ) { global $wgStylePath; $wgOut->addHTML( " @@ -1197,7 +1196,7 @@ wgUploadAutoFill = {$autofill}; } } - if ( !$this->mReUpload && $wgUseCopyrightUpload ) { + if ( !$this->mForReUpload && $wgUseCopyrightUpload ) { $filestatus = wfMsgExt( 'filestatus', 'escapenoentities' ); $copystatus = htmlspecialchars( $this->mCopyrightStatus ); $filesource = wfMsgExt( 'filesource', 'escapenoentities' ); @@ -1250,7 +1249,7 @@ wgUploadAutoFill = {$autofill}; " . Xml::closeElement( 'table' ) . Xml::hidden( 'wpDestFileWarningAck', '', array( 'id' => 'wpDestFileWarningAck' ) ) . - xml::hidden( 'wpReUpload', $this->mReUpload ) . + Xml::hidden( 'wpForReUpload', $this->mForReUpload ) . Xml::closeElement( 'fieldset' ) . Xml::closeElement( 'form' ) ); -- 2.20.1