(bug 9237) SpecialBrokenRedirects.php: Exclude iw redirects
authorTimo Tijhof <ttijhof@wikimedia.org>
Wed, 19 Sep 2012 14:41:28 +0000 (16:41 +0200)
committerTimo Tijhof <ttijhof@wikimedia.org>
Thu, 27 Sep 2012 01:40:41 +0000 (03:40 +0200)
* Cleaned up code
* Difference:
  Added `(rd_interwiki IS NULL OR rd_interwiki = "")` condition.

Change-Id: Ifee9fdcdd3a327742b18cfcc2a235e1e24c062bf

RELEASE-NOTES-1.20
includes/specials/SpecialBrokenRedirects.php

index ba828d8..9c4d5b2 100644 (file)
@@ -247,8 +247,9 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 40214) Category pages no longer use deprecated "width" HTML attribute.
 * (bug 39941) Add missing stylesheets to the installer pages
 * In HTML5 mode, allow new input element types values (such as color, range..)
-* (bug 40353) SpecialDoubleRedirect should support for interwiki redirects.
-* (bug 40352) fixDoubleRedirects.php should support for interwiki redirects.
+* (bug 40353) SpecialDoubleRedirect should support interwiki redirects.
+* (bug 40352) fixDoubleRedirects.php should support interwiki redirects.
+* (bug 9237) SpecialBrokenRedirect should not list interwiki redirects.
 
 === API changes in 1.20 ===
 * (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API.
index 9fa499c..97de72a 100644 (file)
@@ -51,25 +51,35 @@ class BrokenRedirectsPage extends QueryPage {
 
        function getQueryInfo() {
                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 = "")',
+                               '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'
-                                       ) )
-                       )
                );
        }