summaryrefslogtreecommitdiff
path: root/includes/filerepo/FileRepo.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2008-03-21 11:49:34 +0100
committerPierre Schmitz <pierre@archlinux.de>2008-03-21 11:49:34 +0100
commit086ae52d12011746a75f5588e877347bc0457352 (patch)
treee73263c7a29d0f94fafb874562610e16eb292ba8 /includes/filerepo/FileRepo.php
parent749e7fb2bae7bbda855de3c9e319435b9f698ff7 (diff)
Update auf MediaWiki 1.12.0
Diffstat (limited to 'includes/filerepo/FileRepo.php')
-rw-r--r--includes/filerepo/FileRepo.php25
1 files changed, 24 insertions, 1 deletions
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;
+ }
}