r5360 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r5359‎ | r5360 | r5361 >
Date:17:51, 21 September 2004
Author:hashar
Status:old
Tags:
Comment:
Fix http://bugzilla.wikipedia.org/show_bug.cgi?id=538.
Reuploading image should work now.
Modified paths:
  • /trunk/phase3/includes/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialUpload.php
@@ -25,10 +25,14 @@
2626 * @subpackage SpecialPage
2727 */
2828 class UploadForm {
 29+ /**#@+
 30+ * @access private
 31+ */
2932 var $mUploadAffirm, $mUploadFile, $mUploadDescription, $mIgnoreWarning;
3033 var $mUploadSaveName, $mUploadTempName, $mUploadSize, $mUploadOldVersion;
3134 var $mUploadCopyStatus, $mUploadSource, $mReUpload, $mAction, $mUpload;
3235 var $mOname, $mSessionKey;
 36+ /**#@- */
3337
3438 /**
3539 * Constructor : initialise object
@@ -192,13 +196,14 @@
193197 }
194198 if( $nt->getArticleID() ) {
195199 $sk = $wgUser->getSkin();
196 - $dname = $wgLang->getNsText( Namespace::getImage() ) . ":{$this->mUploadSaveName}";
 200+ $dname = $wgLang->getNsText( Namespace::getImage() ) .':'.$this->mUploadSaveName;
197201 $dlink = $sk->makeKnownLink( $dname, $dname );
198202 $warning .= '<li>'.wfMsg( 'fileexists', $dlink ).'</li>';
199203 }
200204 if($warning != '') return $this->uploadWarning($warning);
201205 }
202 - } else {
 206+ } elseif(!isset($this->mUploadSaveName)) {
 207+ // no filename given even when reuploading
203208 return $this->uploadError('<li>'.wfMsg( 'emptyfile' ).'</li>');
204209
205210 }
@@ -210,12 +215,12 @@
211216
212217 $sk = $wgUser->getSkin();
213218 $ilink = $sk->makeMediaLink( $this->mUploadSaveName, Image::wfImageUrl( $this->mUploadSaveName ) );
214 - $dname = $wgLang->getNsText( Namespace::getImage() ) . ":{$this->mUploadSaveName}";
 219+ $dname = $wgLang->getNsText( Namespace::getImage() ) . ':'.$this->mUploadSaveName;
215220 $dlink = $sk->makeKnownLink( $dname, $dname );
216221
217222 $wgOut->addHTML( '<h2>' . wfMsg( 'successfulupload' ) . "</h2>\n" );
218223 $text = wfMsg( 'fileuploaded', $ilink, $dlink );
219 - $wgOut->addHTML( "<p>{$text}\n" );
 224+ $wgOut->addHTML( '<p>'.$text."\n" );
220225 $wgOut->returnToMain( false );
221226 }
222227

Status & tagging log