X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=thumb.php;h=b973cc654bb72207c4466f2d1624f0ede0ba8f62;hb=36f4e6822cafa129078263bdbf67486cb9e8bed1;hp=079ce72f96fb5e784f4cc76e3ba529947e8b7377;hpb=a52e560d2c51d7c8eccab8ca2de087b3ef0c6e37;p=lhc%2Fweb%2Fwiklou.git diff --git a/thumb.php b/thumb.php index 079ce72f96..b973cc654b 100644 --- a/thumb.php +++ b/thumb.php @@ -49,7 +49,18 @@ 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::makeTitleSafe( NS_FILE, $bits[1] ); + if( is_null($title) ) { + wfThumbError( 404, wfMsg( 'badtitletext' ) ); + return; + } + $img = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $fileName ); } else { $img = wfLocalFile( $fileName ); }