Merge "Show the revision list immediately on "umerge" log action links"
[lhc/web/wiklou.git] / includes / filerepo / file / OldLocalFile.php
index ca92496..710058f 100644 (file)
@@ -79,7 +79,7 @@ class OldLocalFile extends LocalFile {
         * Create a OldLocalFile from a SHA-1 key
         * Do not call this except from inside a repo class.
         *
-        * @param string $sha1 base-36 SHA-1
+        * @param string $sha1 Base-36 SHA-1
         * @param LocalRepo $repo
         * @param string|bool $timestamp MW_timestamp (optional)
         *
@@ -130,7 +130,7 @@ class OldLocalFile extends LocalFile {
         * @param Title $title
         * @param FileRepo $repo
         * @param string $time Timestamp or null to load by archive name
-        * @param string $archiveName archive name or null to load by timestamp
+        * @param string $archiveName Archive name or null to load by timestamp
         * @throws MWException
         */
        function __construct( $title, $repo, $time, $archiveName ) {
@@ -404,4 +404,18 @@ class OldLocalFile extends LocalFile {
 
                return true;
        }
+
+       /**
+        * If archive name is an empty string, then file does not "exist"
+        *
+        * This is the case for a couple files on Wikimedia servers where
+        * the old version is "lost".
+        */
+       public function exists() {
+               $archiveName = $this->getArchiveName();
+               if ( $archiveName === '' || !is_string( $archiveName ) ) {
+                       return false;
+               }
+               return parent::exists();
+       }
 }