Special:Shortpages should return pages from all content namespaces, not just NS_MAIN.
authorDaniel Cannon <amidaniel@users.mediawiki.org>
Thu, 24 Apr 2008 18:50:40 +0000 (18:50 +0000)
committerDaniel Cannon <amidaniel@users.mediawiki.org>
Thu, 24 Apr 2008 18:50:40 +0000 (18:50 +0000)
RELEASE-NOTES
includes/SpecialShortpages.php

index fcbcedf..1e431ba 100644 (file)
@@ -90,6 +90,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   text from Special:UserLogin title (new message 'nav-login-createaccount')
 * Say "log in / create account" if an anonymous user can create an account,
   otherwise just "log in", consistently across skins
+* Special:Shortpages returns pages in all content namespaces, not just NS_MAIN.
 
 === Bug fixes in 1.13 ===
 
index f375ecf..bb2ef66 100644 (file)
@@ -27,18 +27,26 @@ class ShortPagesPage extends QueryPage {
        }
 
        function getSQL() {
+               global $wgContentNamespaces;
+
                $dbr = wfGetDB( DB_SLAVE );
                $page = $dbr->tableName( 'page' );
                $name = $dbr->addQuotes( $this->getName() );
 
                $forceindex = $dbr->useIndexClause("page_len");
+
+               if ($wgContentNamespaces)
+                       $nsclause = "page_namespace IN (" . implode(',', $wgContentNamespaces) . ")";
+               else
+                       $nsclause = "page_namespace = " . NS_MAIN;
+
                return
                        "SELECT $name as type,
                                page_namespace as namespace,
                                page_title as title,
                                page_len AS value
                        FROM $page $forceindex
-                       WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0";
+                       WHERE $nsclause AND page_is_redirect=0";
        }
 
        function preprocessResults( $db, $res ) {