From: Aaron Schulz Date: Wed, 13 Aug 2008 01:11:45 +0000 (+0000) Subject: we need a $title here X-Git-Tag: 1.31.0-rc.0~45931 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/fiche.php?a=commitdiff_plain;h=c7b992acd312f391cfbe6d6db5542ff4ec415bd5;p=lhc%2Fweb%2Fwiklou.git we need a $title here --- diff --git a/thumb.php b/thumb.php index 079ce72f96..24bd3d2de2 100644 --- a/thumb.php +++ b/thumb.php @@ -49,7 +49,14 @@ function wfThumbMain() { // Actually fetch the image. Method depends on whether it is archived or not. if( $isOld ) { - $img = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $fileName ); + // Format is ! + $bits = explode( '!', $fileName, 2 ); + if( !isset($bits[1]) ) { + wfThumbError( 404, wfMsg( 'badtitletext' ) ); + return; + } + $title = Title::makeTitle( NS_IMAGE, $bits[1] ); + $img = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $fileName ); } else { $img = wfLocalFile( $fileName ); }