r39263 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39262‎ | r39263 | r39264 >
Date:01:24, 13 August 2008
Author:aaron
Status:old
Tags:
Comment:
use makeTitleSafe()
Modified paths:
  • /trunk/phase3/thumb.php (modified) (history)

Diff [purge]

Index: trunk/phase3/thumb.php
@@ -55,7 +55,11 @@
5656 wfThumbError( 404, wfMsg( 'badtitletext' ) );
5757 return;
5858 }
59 - $title = Title::makeTitle( NS_IMAGE, $bits[1] );
 59+ $title = Title::makeTitleSafe( NS_IMAGE, $bits[1] );
 60+ if( is_null($title) ) {
 61+ wfThumbError( 404, wfMsg( 'badtitletext' ) );
 62+ return;
 63+ }
6064 $img = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $fileName );
6165 } else {
6266 $img = wfLocalFile( $fileName );

Status & tagging log