r76304 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76303‎ | r76304 | r76305 >
Date:14:46, 8 November 2010
Author:hartman
Status:ok
Tags:
Comment:
Filerepo inconsistency. Use rawurlencode instead of urlencode.
Modified paths:
  • /trunk/phase3/includes/filerepo/ForeignAPIRepo.php (modified) (history)
  • /trunk/phase3/includes/filerepo/OldLocalFile.php (modified) (history)
  • /trunk/phase3/includes/filerepo/UnregisteredLocalFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/OldLocalFile.php
@@ -139,7 +139,7 @@
140140 }
141141
142142 function getUrlRel() {
143 - return 'archive/' . $this->getHashPath() . urlencode( $this->getArchiveName() );
 143+ return 'archive/' . $this->getHashPath() . rawurlencode( $this->getArchiveName() );
144144 }
145145
146146 function upgradeRow() {
Index: trunk/phase3/includes/filerepo/ForeignAPIRepo.php
@@ -254,7 +254,7 @@
255255 }
256256 $localPath = $this->getZonePath( 'thumb' ) . "/" . $this->getHashPath( $name ) . $name;
257257 $localFilename = $localPath . "/" . $fileName;
258 - $localUrl = $this->getZoneUrl( 'thumb' ) . "/" . $this->getHashPath( $name ) . urlencode( $name ) . "/" . urlencode( $fileName );
 258+ $localUrl = $this->getZoneUrl( 'thumb' ) . "/" . $this->getHashPath( $name ) . rawurlencode( $name ) . "/" . rawurlencode( $fileName );
259259
260260 if( file_exists( $localFilename ) && isset( $metadata['timestamp'] ) ) {
261261 wfDebug( __METHOD__ . " Thumbnail was already downloaded before\n" );
Index: trunk/phase3/includes/filerepo/UnregisteredLocalFile.php
@@ -100,7 +100,7 @@
101101
102102 function getURL() {
103103 if ( $this->repo ) {
104 - return $this->repo->getZoneUrl( 'public' ) . '/' . $this->repo->getHashPath( $this->name ) . urlencode( $this->name );
 104+ return $this->repo->getZoneUrl( 'public' ) . '/' . $this->repo->getHashPath( $this->name ) . rawurlencode( $this->name );
105105 } else {
106106 return false;
107107 }

Status & tagging log