r39260 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39259‎ | r39260 | r39261 >
Date:01:01, 13 August 2008
Author:aaron
Status:old
Tags:
Comment:
check 'archived' param
Modified paths:
  • /trunk/phase3/thumb.php (modified) (history)

Diff [purge]

Index: trunk/phase3/thumb.php
@@ -40,10 +40,20 @@
4141 }
4242 unset( $params['r'] );
4343
 44+ // Is this a thumb of an archived file?
 45+ $isOld = (isset( $params['archived'] ) && $params['archived']);
 46+ unset( $params['archived'] );
 47+
4448 // Some basic input validation
4549 $fileName = strtr( $fileName, '\\/', '__' );
4650
47 - $img = wfLocalFile( $fileName );
 51+ // Actually fetch the image. Method depends on whether it is archived or not.
 52+ if( $isOld ) {
 53+ $img = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $fileName );
 54+ } else {
 55+ $img = wfLocalFile( $fileName );
 56+ }
 57+
4858 if ( !$img ) {
4959 wfThumbError( 404, wfMsg( 'badtitletext' ) );
5060 return;

Status & tagging log