From 086ae52d12011746a75f5588e877347bc0457352 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 21 Mar 2008 11:49:34 +0100 Subject: Update auf MediaWiki 1.12.0 --- includes/filerepo/FileRepo.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'includes/filerepo/FileRepo.php') diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index cf6d65c2..ee7691a6 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -82,7 +82,7 @@ abstract class FileRepo { if ( !$img ) { return false; } - if ( $img->exists() && ( !$time || $img->getTimestamp() <= $time ) ) { + if ( $img->exists() && ( !$time || $img->getTimestamp() == $time ) ) { return $img; } # Now try an old version of the file @@ -90,6 +90,19 @@ abstract class FileRepo { if ( $img->exists() ) { return $img; } + + # Now try redirects + $redir = $this->checkRedirect( $title ); + if( $redir && $redir->getNamespace() == NS_IMAGE) { + $img = $this->newFile( $redir ); + if( !$img ) { + return false; + } + if( $img->exists() ) { + $img->redirectedFrom( $title->getText() ); + return $img; + } + } } /** @@ -400,5 +413,15 @@ abstract class FileRepo { * STUB */ function cleanupDeletedBatch( $storageKeys ) {} + + /** + * Checks if there is a redirect named as $title + * STUB + * + * @param Title $title Title of image + */ + function checkRedirect( $title ) { + return false; + } } -- cgit v1.2.3-54-g00ecf