* 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)
*
* @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 ) {
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();
+ }
}