Filerepo inconsistency. Use rawurlencode instead of urlencode.
authorDerk-Jan Hartman <hartman@users.mediawiki.org>
Mon, 8 Nov 2010 14:46:26 +0000 (14:46 +0000)
committerDerk-Jan Hartman <hartman@users.mediawiki.org>
Mon, 8 Nov 2010 14:46:26 +0000 (14:46 +0000)
includes/filerepo/ForeignAPIRepo.php
includes/filerepo/OldLocalFile.php
includes/filerepo/UnregisteredLocalFile.php

index 512c6cb..ffae9f4 100644 (file)
@@ -254,7 +254,7 @@ class ForeignAPIRepo extends FileRepo {
                        }
                        $localPath =  $this->getZonePath( 'thumb' ) . "/" . $this->getHashPath( $name ) . $name;
                        $localFilename = $localPath . "/" . $fileName;
-                       $localUrl =  $this->getZoneUrl( 'thumb' ) . "/" . $this->getHashPath( $name ) . urlencode( $name ) . "/" . urlencode( $fileName );
+                       $localUrl =  $this->getZoneUrl( 'thumb' ) . "/" . $this->getHashPath( $name ) . rawurlencode( $name ) . "/" . rawurlencode( $fileName );
 
                        if( file_exists( $localFilename ) && isset( $metadata['timestamp'] ) ) {
                                wfDebug( __METHOD__ . " Thumbnail was already downloaded before\n" );
index d80e896..9efe998 100644 (file)
@@ -139,7 +139,7 @@ class OldLocalFile extends LocalFile {
        }
 
        function getUrlRel() {
-               return 'archive/' . $this->getHashPath() . urlencode( $this->getArchiveName() );
+               return 'archive/' . $this->getHashPath() . rawurlencode( $this->getArchiveName() );
        }
 
        function upgradeRow() {
index 99f6913..990a218 100644 (file)
@@ -100,7 +100,7 @@ class UnregisteredLocalFile extends File {
 
        function getURL() {
                if ( $this->repo ) {
-                       return $this->repo->getZoneUrl( 'public' ) . '/' . $this->repo->getHashPath( $this->name ) . urlencode( $this->name );
+                       return $this->repo->getZoneUrl( 'public' ) . '/' . $this->repo->getHashPath( $this->name ) . rawurlencode( $this->name );
                } else {
                        return false;
                }