[FileBackend] Make sure multiwrite sub-backends use the proxy backend wiki ID.
[lhc/web/wiklou.git] / includes / filerepo / LocalRepo.php
index 1b8042d..dd0c947 100644 (file)
@@ -39,7 +39,7 @@ class LocalRepo extends FileRepo {
        /**
         * @throws MWException
         * @param $row
-        * @return File
+        * @return LocalFile
         */
        function newFileFromRow( $row ) {
                if ( isset( $row->img_name ) ) {
@@ -148,7 +148,7 @@ class LocalRepo extends FileRepo {
        public static function getHashFromKey( $key ) {
                return strtok( $key, '.' );
        }
-       
+
        /**
         * Checks if there is a redirect named as $title
         *
@@ -198,7 +198,6 @@ class LocalRepo extends FileRepo {
                }
        }
 
-
        /**
         * Function link Title::getArticleID().
         * We can't say Title object, what database it should use, so we duplicate that function here.
@@ -235,7 +234,9 @@ class LocalRepo extends FileRepo {
                $res = $dbr->select(
                        'image',
                        LocalFile::selectFields(),
-                       array( 'img_sha1' => $hash )
+                       array( 'img_sha1' => $hash ),
+                       __METHOD__,
+                       array( 'ORDER BY' => 'img_name' )
                );
                
                $result = array();