Made FileRepo::newFileFromKey actually work
authorAaron Schulz <aaron@users.mediawiki.org>
Tue, 22 Mar 2011 20:34:50 +0000 (20:34 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Tue, 22 Mar 2011 20:34:50 +0000 (20:34 +0000)
includes/filerepo/FileRepo.php
includes/filerepo/LocalRepo.php

index 4ad6af5..defb67d 100644 (file)
@@ -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;
        }
 
        /**
index e72f32b..662dfd9 100644 (file)
@@ -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' );