Index: trunk/phase3/includes/SpecialUpload.php |
— | — | @@ -25,10 +25,14 @@ |
26 | 26 | * @subpackage SpecialPage |
27 | 27 | */ |
28 | 28 | class UploadForm { |
| 29 | + /**#@+ |
| 30 | + * @access private |
| 31 | + */ |
29 | 32 | var $mUploadAffirm, $mUploadFile, $mUploadDescription, $mIgnoreWarning; |
30 | 33 | var $mUploadSaveName, $mUploadTempName, $mUploadSize, $mUploadOldVersion; |
31 | 34 | var $mUploadCopyStatus, $mUploadSource, $mReUpload, $mAction, $mUpload; |
32 | 35 | var $mOname, $mSessionKey; |
| 36 | + /**#@- */ |
33 | 37 | |
34 | 38 | /** |
35 | 39 | * Constructor : initialise object |
— | — | @@ -192,13 +196,14 @@ |
193 | 197 | } |
194 | 198 | if( $nt->getArticleID() ) { |
195 | 199 | $sk = $wgUser->getSkin(); |
196 | | - $dname = $wgLang->getNsText( Namespace::getImage() ) . ":{$this->mUploadSaveName}"; |
| 200 | + $dname = $wgLang->getNsText( Namespace::getImage() ) .':'.$this->mUploadSaveName; |
197 | 201 | $dlink = $sk->makeKnownLink( $dname, $dname ); |
198 | 202 | $warning .= '<li>'.wfMsg( 'fileexists', $dlink ).'</li>'; |
199 | 203 | } |
200 | 204 | if($warning != '') return $this->uploadWarning($warning); |
201 | 205 | } |
202 | | - } else { |
| 206 | + } elseif(!isset($this->mUploadSaveName)) { |
| 207 | + // no filename given even when reuploading |
203 | 208 | return $this->uploadError('<li>'.wfMsg( 'emptyfile' ).'</li>'); |
204 | 209 | |
205 | 210 | } |
— | — | @@ -210,12 +215,12 @@ |
211 | 216 | |
212 | 217 | $sk = $wgUser->getSkin(); |
213 | 218 | $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; |
215 | 220 | $dlink = $sk->makeKnownLink( $dname, $dname ); |
216 | 221 | |
217 | 222 | $wgOut->addHTML( '<h2>' . wfMsg( 'successfulupload' ) . "</h2>\n" ); |
218 | 223 | $text = wfMsg( 'fileuploaded', $ilink, $dlink ); |
219 | | - $wgOut->addHTML( "<p>{$text}\n" ); |
| 224 | + $wgOut->addHTML( '<p>'.$text."\n" ); |
220 | 225 | $wgOut->returnToMain( false ); |
221 | 226 | } |
222 | 227 | |