(bug 13556, and possible regression from r32372) Don't show a blank form if no image...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 29 Mar 2008 17:40:55 +0000 (17:40 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 29 Mar 2008 17:40:55 +0000 (17:40 +0000)
RELEASE-NOTES
includes/SpecialUpload.php

index f08ea7a..9560267 100644 (file)
@@ -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 ===
 
index 9dae81d..a8aa91e 100644 (file)
@@ -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' );