r56694 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56693‎ | r56694 | r56695 >
Date:01:33, 21 September 2009
Author:demon
Status:ok
Tags:
Comment:
(bug 20751) ForeignApiRepo does not urldecode filenames. Based on patch by Marcin Cieślak.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/filerepo/ForeignAPIRepo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/ForeignAPIRepo.php
@@ -188,7 +188,7 @@
189189 $foreignUrl = $this->getThumbUrl( $name, $width, $height );
190190
191191 // We need the same filename as the remote one :)
192 - $fileName = ltrim( substr( $foreignUrl, strrpos( $foreignUrl, '/' ) ), '/' );
 192+ $fileName = rawurldecode( pathinfo( $foreignUrl, PATHINFO_BASENAME ) );
193193 $path = 'thumb/' . $this->getHashPath( $name ) . $name . "/";
194194 if ( !is_dir($wgUploadDirectory . '/' . $path) ) {
195195 wfMkdirParents($wgUploadDirectory . '/' . $path);
Index: trunk/phase3/RELEASE-NOTES
@@ -520,6 +520,7 @@
521521 by disable_functions
522522 * (bug 20726) Title::getLatestRevID's documentation now says that the function
523523 returns false if the page doesn't exist
 524+* (bug 20751) ForeignApiRepo now urldecodes filenames when saving to local cache
524525
525526 == API changes in 1.16 ==
526527

Status & tagging log