Better false positive detection for Special:Wantedfiles
authorBrian Wolff <bawolff+wn@gmail.com>
Sat, 19 Jul 2014 15:06:48 +0000 (12:06 -0300)
committerBrian Wolff <bawolff+wn@gmail.com>
Sun, 14 Sep 2014 22:14:52 +0000 (19:14 -0300)
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

index 8269b01..937a503 100644 (file)
@@ -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(