Making missing old files not try to render a thumbnail
[lhc/web/wiklou.git] / includes / filerepo / file / OldLocalFile.php
index 0adcc73..710058f 100644 (file)
@@ -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();
+       }
 }