From c546c5671b4a639159a66c92489a3e31e1188b9c Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 11 Jun 2007 22:36:47 +0000 Subject: [PATCH] Fix incorrect virtual URL encoding in storeTemp --- includes/filerepo/FSRepo.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/filerepo/FSRepo.php b/includes/filerepo/FSRepo.php index dac3500220..39684847a2 100644 --- a/includes/filerepo/FSRepo.php +++ b/includes/filerepo/FSRepo.php @@ -226,13 +226,16 @@ class FSRepo { * @param string $srcPath The current location of the file. */ function storeTemp( $originalName, $srcPath ) { - $dstRel = $this->getHashPath( $originalName ) . - gmdate( "YmdHis" ) . '!' . $originalName; + $date = gmdate( "YmdHis" ); + $hashPath = $this->getHashPath( $originalName ); + $dstRel = "$hashPath$date!$originalName"; + $dstUrlRel = $hashPath . $date . '!' . rawurlencode( $originalName ); + $result = $this->store( $srcPath, 'temp', $dstRel ); if ( WikiError::isError( $result ) ) { return $result; } else { - return $this->getVirtualUrl( "temp/$dstRel" ); + return $this->getVirtualUrl( 'temp' ) . '/' . $dstUrlRel; } } -- 2.20.1