r39261 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39260‎ | r39261 | r39262 >
Date:01:11, 13 August 2008
Author:aaron
Status:old
Tags:
Comment:
we need a $title here
Modified paths:
  • /trunk/phase3/thumb.php (modified) (history)

Diff [purge]

Index: trunk/phase3/thumb.php
@@ -49,7 +49,14 @@
5050
5151 // Actually fetch the image. Method depends on whether it is archived or not.
5252 if( $isOld ) {
53 - $img = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $fileName );
 53+ // Format is <timestamp>!<name>
 54+ $bits = explode( '!', $fileName, 2 );
 55+ if( !isset($bits[1]) ) {
 56+ wfThumbError( 404, wfMsg( 'badtitletext' ) );
 57+ return;
 58+ }
 59+ $title = Title::makeTitle( NS_IMAGE, $bits[1] );
 60+ $img = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $fileName );
5461 } else {
5562 $img = wfLocalFile( $fileName );
5663 }

Status & tagging log