r50977 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50976‎ | r50977 | r50978 >
Date:13:53, 25 May 2009
Author:siebrand
Status:resolved (Comments)
Tags:
Comment:
* feed arrays into getFullURL() for readability
* fix indentation (spaces to tab)
Modified paths:
  • /trunk/phase3/includes/ImagePage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImagePage.php
@@ -460,7 +460,7 @@
461461 <span class="fileInfo">$longDesc</span>
462462 </div>
463463 EOT
464 - );
 464+ );
465465 }
466466 }
467467
@@ -471,10 +471,11 @@
472472 # Image does not exist
473473 if ( $wgEnableUploads && $wgUser->isAllowed( 'upload' ) ) {
474474 // Only show an upload link if the user can upload
475 - $uploadTitle = SpecialPage::getTitleFor( 'Upload' );
476 - $nofile = wfMsgHtml('filepage-nofile-link',
477 - $uploadTitle->getFullUrl( 'wpDestFile=' . urlencode( $this->img->getName() ) )
478 - );
 475+ $uploadTitle = SpecialPage::getTitleFor( 'Upload' );
 476+ $nofile = wfMsgHtml(
 477+ 'filepage-nofile-link',
 478+ $uploadTitle->getFullUrl( array( 'wpDestFile' => urlencode( $this->img->getName() ) ) )
 479+ );
479480 }
480481 else
481482 {
@@ -516,7 +517,10 @@
517518 public function getUploadUrl() {
518519 $this->loadFile();
519520 $uploadTitle = SpecialPage::getTitleFor( 'Upload' );
520 - return $uploadTitle->getFullUrl( 'wpDestFile=' . urlencode( $this->img->getName() ) . '&wpForReUpload=1' );
 521+ return $uploadTitle->getFullUrl( array(
 522+ 'wpDestFile' => urlencode( $this->img->getName() ),
 523+ 'wpForReUpload' => 1
 524+ ) );
521525 }
522526
523527 /**

Comments

#Comment by Tim Starling (talk | contribs)   05:08, 27 May 2009

You're double-escaping.

#Comment by Siebrand (talk | contribs)   07:47, 27 May 2009

Was fixed by nikerabbit in r50978

Status & tagging log