From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- includes/specials/SpecialBrokenRedirects.php | 63 +++++++++++++++++++--------- 1 file changed, 43 insertions(+), 20 deletions(-) (limited to 'includes/specials/SpecialBrokenRedirects.php') diff --git a/includes/specials/SpecialBrokenRedirects.php b/includes/specials/SpecialBrokenRedirects.php index 8119e6d1..fac41236 100644 --- a/includes/specials/SpecialBrokenRedirects.php +++ b/includes/specials/SpecialBrokenRedirects.php @@ -33,35 +33,54 @@ class BrokenRedirectsPage extends QueryPage { parent::__construct( $name ); } - function isExpensive() { return true; } - function isSyndicated() { return false; } - function sortDescending() { return false; } + function isExpensive() { + return true; + } + + function isSyndicated() { + return false; + } + + function sortDescending() { + return false; + } function getPageHeader() { return $this->msg( 'brokenredirectstext' )->parseAsBlock(); } function getQueryInfo() { + $dbr = wfGetDB( DB_SLAVE ); return array( - 'tables' => array( 'redirect', 'p1' => 'page', - 'p2' => 'page' ), - 'fields' => array( 'namespace' => 'p1.page_namespace', - 'title' => 'p1.page_title', - 'value' => 'p1.page_title', - 'rd_namespace', - 'rd_title' + 'tables' => array( + 'redirect', + 'p1' => 'page', + 'p2' => 'page', ), - 'conds' => array( 'rd_namespace >= 0', - 'p2.page_namespace IS NULL' + 'fields' => array( + 'namespace' => 'p1.page_namespace', + 'title' => 'p1.page_title', + 'value' => 'p1.page_title', + 'rd_namespace', + 'rd_title', + ), + 'conds' => array( + // Exclude pages that don't exist locally as wiki pages, + // but aren't "broken" either. + // Special pages and interwiki links + 'rd_namespace >= 0', + 'rd_interwiki IS NULL OR rd_interwiki = ' . $dbr->addQuotes( '' ), + 'p2.page_namespace IS NULL', + ), + 'join_conds' => array( + 'p1' => array( 'JOIN', array( + 'rd_from=p1.page_id', + ) ), + 'p2' => array( 'LEFT JOIN', array( + 'rd_namespace=p2.page_namespace', + 'rd_title=p2.page_title' + ) ), ), - 'join_conds' => array( 'p1' => array( 'JOIN', array( - 'rd_from=p1.page_id', - ) ), - 'p2' => array( 'LEFT JOIN', array( - 'rd_namespace=p2.page_namespace', - 'rd_title=p2.page_title' - ) ) - ) ); } @@ -132,4 +151,8 @@ class BrokenRedirectsPage extends QueryPage { $out .= " {$arr} {$to}"; return $out; } + + protected function getGroupName() { + return 'maintenance'; + } } -- cgit v1.2.2