r44989 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44988‎ | r44989 | r44990 >
Date:23:19, 23 December 2008
Author:brion
Status:ok
Tags:
Comment:
Follow-up to r44987 -- use the Title-filtered version for the rest of our filename processing just to be sure everything's cool. :)
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -400,16 +400,19 @@
401401 }
402402 $filtered = wfStripIllegalFilenameChars( $basename );
403403
 404+ /* Normalize to title form before we do any further processing */
404405 $nt = Title::makeTitleSafe( NS_FILE, $filtered );
405406 if( is_null( $nt ) ) {
406407 $resultDetails = array( 'filtered' => $filtered );
407408 return self::ILLEGAL_FILENAME;
408409 }
 410+ $filtered = $nt->getDBkey();
 411+
409412 /**
410413 * We'll want to blacklist against *any* 'extension', and use
411414 * only the final one for the whitelist.
412415 */
413 - list( $partname, $ext ) = $this->splitExtensions( $nt->getDBkey() );
 416+ list( $partname, $ext ) = $this->splitExtensions( $filtered );
414417
415418 if( count( $ext ) ) {
416419 $finalExt = $ext[count( $ext ) - 1];

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r44987(bug 16772) Special:Upload now correctly rejects files with spaces in the fil...mrzman23:00, 23 December 2008

Status & tagging log