From: Aaron Schulz Date: Wed, 13 Aug 2008 01:01:58 +0000 (+0000) Subject: check 'archived' param X-Git-Tag: 1.31.0-rc.0~45932 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=a52e560d2c51d7c8eccab8ca2de087b3ef0c6e37;p=lhc%2Fweb%2Fwiklou.git check 'archived' param --- diff --git a/thumb.php b/thumb.php index 677979a0f4..079ce72f96 100644 --- a/thumb.php +++ b/thumb.php @@ -40,10 +40,20 @@ function wfThumbMain() { } unset( $params['r'] ); + // Is this a thumb of an archived file? + $isOld = (isset( $params['archived'] ) && $params['archived']); + unset( $params['archived'] ); + // Some basic input validation $fileName = strtr( $fileName, '\\/', '__' ); - $img = wfLocalFile( $fileName ); + // Actually fetch the image. Method depends on whether it is archived or not. + if( $isOld ) { + $img = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $fileName ); + } else { + $img = wfLocalFile( $fileName ); + } + if ( !$img ) { wfThumbError( 404, wfMsg( 'badtitletext' ) ); return;