X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/mediawiki.git/blobdiff_plain/87219ebd28426c6d21cb545233ee52f5f7af7dfd..18a6620945d02687fbcfc4c27355d952fd748b41:/includes/specials/SpecialWantedfiles.php diff --git a/includes/specials/SpecialWantedfiles.php b/includes/specials/SpecialWantedfiles.php index 189b9d8b..d6c1157b 100644 --- a/includes/specials/SpecialWantedfiles.php +++ b/includes/specials/SpecialWantedfiles.php @@ -1,17 +1,33 @@ */ /** - * Querypage that lists the most wanted files - implements Special:Wantedfiles + * Querypage that lists the most wanted files * * @ingroup SpecialPage - * - * @author Soxred93 - * @copyright Copyright © 2008, Soxred93 - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ class WantedFilesPage extends WantedQueryPage { @@ -19,9 +35,19 @@ class WantedFilesPage extends WantedQueryPage { return 'Wantedfiles'; } + /** + * KLUGE: The results may contain false positives for files + * that exist e.g. in a shared repo. Setting this at least + * keeps them from showing up as redlinks in the output, even + * if it doesn't fix the real problem (bug 6220). + */ + function forceExistenceCheck() { + return true; + } + function getSQL() { $dbr = wfGetDB( DB_SLAVE ); - list( $imagelinks, $page ) = $dbr->tableNamesN( 'imagelinks', 'page' ); + list( $imagelinks, $image ) = $dbr->tableNamesN( 'imagelinks', 'image' ); $name = $dbr->addQuotes( $this->getName() ); return " @@ -31,8 +57,8 @@ class WantedFilesPage extends WantedQueryPage { il_to as title, COUNT(*) as value FROM $imagelinks - LEFT JOIN $page ON il_to = page_title AND page_namespace = ". NS_FILE ." - WHERE page_title IS NULL + LEFT JOIN $image ON il_to = img_name + WHERE img_name IS NULL GROUP BY il_to "; }