Fix incorrect virtual URL encoding in storeTemp
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 11 Jun 2007 22:36:47 +0000 (22:36 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 11 Jun 2007 22:36:47 +0000 (22:36 +0000)
includes/filerepo/FSRepo.php

index dac3500..3968484 100644 (file)
@@ -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;
                }
        }