Index: trunk/phase3/thumb.php |
— | — | @@ -40,10 +40,20 @@ |
41 | 41 | } |
42 | 42 | unset( $params['r'] ); |
43 | 43 | |
| 44 | + // Is this a thumb of an archived file? |
| 45 | + $isOld = (isset( $params['archived'] ) && $params['archived']); |
| 46 | + unset( $params['archived'] ); |
| 47 | + |
44 | 48 | // Some basic input validation |
45 | 49 | $fileName = strtr( $fileName, '\\/', '__' ); |
46 | 50 | |
47 | | - $img = wfLocalFile( $fileName ); |
| 51 | + // Actually fetch the image. Method depends on whether it is archived or not. |
| 52 | + if( $isOld ) { |
| 53 | + $img = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $fileName ); |
| 54 | + } else { |
| 55 | + $img = wfLocalFile( $fileName ); |
| 56 | + } |
| 57 | + |
48 | 58 | if ( !$img ) { |
49 | 59 | wfThumbError( 404, wfMsg( 'badtitletext' ) ); |
50 | 60 | return; |