From c7b992acd312f391cfbe6d6db5542ff4ec415bd5 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 13 Aug 2008 01:11:45 +0000 Subject: [PATCH] we need a $title here --- thumb.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 ); } -- 2.20.1