Bug 42445: Fix file revert with local repo
authorJan Gerber <jgerber@wikimedia.org>
Mon, 26 Nov 2012 11:42:09 +0000 (11:42 +0000)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 26 Nov 2012 18:29:04 +0000 (10:29 -0800)
reverting a file a virtual url is passed to upload without props,
get props from backend, virutal urls are not local files.

Change-Id: I1d56a6237e1d2af9941f29e4ba3f0262817b0e8d

includes/filerepo/file/LocalFile.php

index c2c17f5..da1e1fa 100644 (file)
@@ -974,9 +974,13 @@ class LocalFile extends File {
 
                if ( !$props ) {
                        wfProfileIn( __METHOD__ . '-getProps' );
-                       $props = FileBackend::isStoragePath( $srcPath )
-                               ? $this->repo->getFileProps( $srcPath )
-                               : FSFile::getPropsFromPath( $srcPath );
+                       if ( $this->repo->isVirtualUrl( $srcPath )
+                               || FileBackend::isStoragePath( $srcPath ) )
+                       {
+                               $props = $this->repo->getFileProps( $srcPath );
+                       } else {
+                               $props = FSFile::getPropsFromPath( $srcPath );
+                       }
                        wfProfileOut( __METHOD__ . '-getProps' );
                }