From: Chad Horohoe Date: Mon, 21 Sep 2009 01:33:06 +0000 (+0000) Subject: (bug 20751) ForeignApiRepo does not urldecode filenames. Based on patch by Marcin... X-Git-Tag: 1.31.0-rc.0~39602 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=7806ec12c8233f9d744b188af9615477b013b872;p=lhc%2Fweb%2Fwiklou.git (bug 20751) ForeignApiRepo does not urldecode filenames. Based on patch by Marcin Cieślak. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e95dd3e9a3..b3ba594b60 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -520,6 +520,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN by disable_functions * (bug 20726) Title::getLatestRevID's documentation now says that the function returns false if the page doesn't exist +* (bug 20751) ForeignApiRepo now urldecodes filenames when saving to local cache == API changes in 1.16 == diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index a569fa5f9b..84e5df6989 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -188,7 +188,7 @@ class ForeignAPIRepo extends FileRepo { $foreignUrl = $this->getThumbUrl( $name, $width, $height ); // We need the same filename as the remote one :) - $fileName = ltrim( substr( $foreignUrl, strrpos( $foreignUrl, '/' ) ), '/' ); + $fileName = rawurldecode( pathinfo( $foreignUrl, PATHINFO_BASENAME ) ); $path = 'thumb/' . $this->getHashPath( $name ) . $name . "/"; if ( !is_dir($wgUploadDirectory . '/' . $path) ) { wfMkdirParents($wgUploadDirectory . '/' . $path);