we need a $title here
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 13 Aug 2008 01:11:45 +0000 (01:11 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 13 Aug 2008 01:11:45 +0000 (01:11 +0000)
thumb.php

index 079ce72..24bd3d2 100644 (file)
--- 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 <timestamp>!<name>
+               $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 );
        }