From efb146bc0b215c44f4876f10d994bde22cbf8946 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 29 Mar 2008 17:40:55 +0000 Subject: [PATCH] (bug 13556, and possible regression from r32372) Don't show a blank form if no image is attached in Special:Upload --- RELEASE-NOTES | 2 +- includes/SpecialUpload.php | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f08ea7a373..95602678d8 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -142,7 +142,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 13543) Updated FAQ link in the installer sidebar * (bug 13540) Date format in confirmation e-mail now matches message language * (bug 13554) PHP Notice in old pre-processor when list item is empty. - +* (bug 13556) Don't show a blank form if no image is attached in Special:Upload === API changes in 1.13 === diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index 9dae81d2fd..a8aa91e1ad 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -280,7 +280,7 @@ class UploadForm { $details = null; $value = null; $value = $this->internalProcessUpload( $details ); - + switch($value) { case self::SUCCESS: $wgOut->redirect( $this->mLocalFile->getTitle()->getFullURL() ); @@ -376,11 +376,6 @@ class UploadForm { return self::BEFORE_PROCESSING; } - /* Check for curl error */ - if( $this->mCurlError ) { - return self::BEFORE_PROCESSING; - } - /** * If there was no filename or a zero size given, give up quick. */ @@ -388,6 +383,11 @@ class UploadForm { return self::EMPTY_FILE; } + /* Check for curl error */ + if( $this->mCurlError ) { + return self::BEFORE_PROCESSING; + } + # Chop off any directories in the given filename if( $this->mDesiredDestName ) { $basename = $this->mDesiredDestName; @@ -998,7 +998,7 @@ wgUploadAutoFill = {$autofill}; $val2 = $val; } $val2 = $wgAllowCopyUploads ? min( $wgMaxUploadSize, $val2 ) : $val2; - $maxUploadSize = wfMsgExt( 'upload-maxfilesize', array( 'parseinline', 'escape' ), $wgLang->formatSize( $val2 ) ); + $maxUploadSize = wfMsgExt( 'upload-maxfilesize', array( 'parseinline', 'escapenoentities' ), $wgLang->formatSize( $val2 ) ); $sourcefilename = wfMsgExt( 'sourcefilename', 'escapenoentities' ); $destfilename = wfMsgExt( 'destfilename', 'escapenoentities' ); -- 2.20.1