From f44b02d36c94be1bbafd8887ba38ee473deb840f Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 22 Mar 2011 20:34:50 +0000 Subject: [PATCH] Made FileRepo::newFileFromKey actually work --- includes/filerepo/FileRepo.php | 7 ++++--- includes/filerepo/LocalRepo.php | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 4ad6af573b..defb67d22e 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -193,12 +193,13 @@ abstract class FileRepo { if ( $time ) { if ( $this->oldFileFactoryKey ) { return call_user_func( $this->oldFileFactoryKey, $sha1, $this, $time ); - } else { - return false; } } else { - return call_user_func( $this->fileFactoryKey, $sha1, $this ); + if ( $this->fileFactoryKey ) { + return call_user_func( $this->fileFactoryKey, $sha1, $this ); + } } + return false; } /** diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php index e72f32b858..662dfd9ffb 100644 --- a/includes/filerepo/LocalRepo.php +++ b/includes/filerepo/LocalRepo.php @@ -14,7 +14,9 @@ */ class LocalRepo extends FSRepo { var $fileFactory = array( 'LocalFile', 'newFromTitle' ); + var $fileFactoryKey = array( 'LocalFile', 'newFromKey' ); var $oldFileFactory = array( 'OldLocalFile', 'newFromTitle' ); + var $oldFileFactoryKey = array( 'OldLocalFile', 'newFromKey' ); var $fileFromRowFactory = array( 'LocalFile', 'newFromRow' ); var $oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' ); -- 2.20.1