r33865 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r33864‎ | r33865 | r33866 >
Date:18:50, 24 April 2008
Author:amidaniel
Status:old
Tags:
Comment:
Special:Shortpages should return pages from all content namespaces, not just NS_MAIN.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialShortpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialShortpages.php
@@ -27,18 +27,26 @@
2828 }
2929
3030 function getSQL() {
 31+ global $wgContentNamespaces;
 32+
3133 $dbr = wfGetDB( DB_SLAVE );
3234 $page = $dbr->tableName( 'page' );
3335 $name = $dbr->addQuotes( $this->getName() );
3436
3537 $forceindex = $dbr->useIndexClause("page_len");
 38+
 39+ if ($wgContentNamespaces)
 40+ $nsclause = "page_namespace IN (" . implode(',', $wgContentNamespaces) . ")";
 41+ else
 42+ $nsclause = "page_namespace = " . NS_MAIN;
 43+
3644 return
3745 "SELECT $name as type,
3846 page_namespace as namespace,
3947 page_title as title,
4048 page_len AS value
4149 FROM $page $forceindex
42 - WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0";
 50+ WHERE $nsclause AND page_is_redirect=0";
4351 }
4452
4553 function preprocessResults( $db, $res ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -90,6 +90,7 @@
9191 text from Special:UserLogin title (new message 'nav-login-createaccount')
9292 * Say "log in / create account" if an anonymous user can create an account,
9393 otherwise just "log in", consistently across skins
 94+* Special:Shortpages returns pages in all content namespaces, not just NS_MAIN.
9495
9596 === Bug fixes in 1.13 ===
9697

Status & tagging log