summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialBrokenRedirects.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialBrokenRedirects.php')
-rw-r--r--includes/specials/SpecialBrokenRedirects.php63
1 files changed, 43 insertions, 20 deletions
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';
+ }
}