From: Brion Vibber Date: Tue, 23 Dec 2008 23:19:14 +0000 (+0000) Subject: Follow-up to r44987 -- use the Title-filtered version for the rest of our filename... X-Git-Tag: 1.31.0-rc.0~43798 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=9e8a7d628a46bf3f15760cbc3d9051e44cf79d0a;p=lhc%2Fweb%2Fwiklou.git Follow-up to r44987 -- use the Title-filtered version for the rest of our filename processing just to be sure everything's cool. :) --- diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index ee0153e3d4..450c8728a1 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -400,16 +400,19 @@ class UploadForm { } $filtered = wfStripIllegalFilenameChars( $basename ); + /* Normalize to title form before we do any further processing */ $nt = Title::makeTitleSafe( NS_FILE, $filtered ); if( is_null( $nt ) ) { $resultDetails = array( 'filtered' => $filtered ); return self::ILLEGAL_FILENAME; } + $filtered = $nt->getDBkey(); + /** * We'll want to blacklist against *any* 'extension', and use * only the final one for the whitelist. */ - list( $partname, $ext ) = $this->splitExtensions( $nt->getDBkey() ); + list( $partname, $ext ) = $this->splitExtensions( $filtered ); if( count( $ext ) ) { $finalExt = $ext[count( $ext ) - 1];