From 70f9d5170e85493a18af10df9dc5ed36f0fc9b54 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Mon, 8 Nov 2010 14:46:26 +0000 Subject: [PATCH] Filerepo inconsistency. Use rawurlencode instead of urlencode. --- includes/filerepo/ForeignAPIRepo.php | 2 +- includes/filerepo/OldLocalFile.php | 2 +- includes/filerepo/UnregisteredLocalFile.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 512c6cb11a..ffae9f463e 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -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" ); diff --git a/includes/filerepo/OldLocalFile.php b/includes/filerepo/OldLocalFile.php index d80e896c9f..9efe998fa8 100644 --- a/includes/filerepo/OldLocalFile.php +++ b/includes/filerepo/OldLocalFile.php @@ -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() { diff --git a/includes/filerepo/UnregisteredLocalFile.php b/includes/filerepo/UnregisteredLocalFile.php index 99f6913f3e..990a218c22 100644 --- a/includes/filerepo/UnregisteredLocalFile.php +++ b/includes/filerepo/UnregisteredLocalFile.php @@ -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; } -- 2.20.1