From 6c12fad6dd1158103cfea104c6afb217d7f63b6d Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Sat, 19 Jul 2014 12:06:48 -0300 Subject: [PATCH] Better false positive detection for Special:Wantedfiles Previously the page crossed out entries based on Title::isKnown. This could potentially catch pages which are valid file redirects, which shouldn't be crossed out. This shouldn't affect anything performance wise, as the previous Title::isKnown check would call wfFindFile anyways. Change-Id: Ia9eac8f5618181c631a5b2b1c461b12a90f2dde7 --- includes/specials/SpecialWantedfiles.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/includes/specials/SpecialWantedfiles.php b/includes/specials/SpecialWantedfiles.php index 8269b01c01..937a503c0f 100644 --- a/includes/specials/SpecialWantedfiles.php +++ b/includes/specials/SpecialWantedfiles.php @@ -93,6 +93,18 @@ class WantedFilesPage extends WantedQueryPage { return true; } + /** + * Does the file exist? + * + * Use wfFindFile so we still think file namespace pages without + * files are missing, but valid file redirects and foreign files are ok. + * + * @return boolean + */ + protected function existenceCheck( Title $title ) { + return (bool) wfFindFile( $title ); + } + function getQueryInfo() { return array( 'tables' => array( -- 2.20.1