r22917 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22916‎ | r22917 | r22918 >
Date:22:36, 11 June 2007
Author:tstarling
Status:old
Tags:
Comment:
Fix incorrect virtual URL encoding in storeTemp
Modified paths:
  • /trunk/phase3/includes/filerepo/FSRepo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/FSRepo.php
@@ -226,13 +226,16 @@
227227 * @param string $srcPath The current location of the file.
228228 */
229229 function storeTemp( $originalName, $srcPath ) {
230 - $dstRel = $this->getHashPath( $originalName ) .
231 - gmdate( "YmdHis" ) . '!' . $originalName;
 230+ $date = gmdate( "YmdHis" );
 231+ $hashPath = $this->getHashPath( $originalName );
 232+ $dstRel = "$hashPath$date!$originalName";
 233+ $dstUrlRel = $hashPath . $date . '!' . rawurlencode( $originalName );
 234+
232235 $result = $this->store( $srcPath, 'temp', $dstRel );
233236 if ( WikiError::isError( $result ) ) {
234237 return $result;
235238 } else {
236 - return $this->getVirtualUrl( "temp/$dstRel" );
 239+ return $this->getVirtualUrl( 'temp' ) . '/' . $dstUrlRel;
237240 }
238241 }
239242

Follow-up revisions

RevisionCommit summaryAuthorDate
r22919Merged revisions 22878-22918 via svnmerge from...david00:00, 12 June 2007

Status & tagging log