r67661 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67660‎ | r67661 | r67662 >
Date:19:36, 8 June 2010
Author:siebrand
Status:reverted
Tags:
Comment:
Replace Title::makeTitle[Safe]( NS_SPECIAL, 'x' ) with SpecialPage::getTitleFor ( 'x' )

And a few other minor changes.
Modified paths:
  • /trunk/phase3/includes/PrefixSearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/PrefixSearch.php
@@ -1,5 +1,4 @@
22 <?php
3 -
43 /**
54 * PrefixSearch - Handles searching prefixes of titles and finding any page
65 * names that match. Used largely by the OpenSearch implementation.
@@ -77,6 +76,7 @@
7877 */
7978 protected static function specialSearch( $search, $limit ) {
8079 global $wgContLang;
 80+
8181 $searchKey = $wgContLang->caseFold( $search );
8282
8383 // Unlike SpecialPage itself, we want the canonical forms of both
@@ -87,9 +87,11 @@
8888 foreach( array_keys( SpecialPage::$mList ) as $page ) {
8989 $keys[$wgContLang->caseFold( $page )] = $page;
9090 }
 91+
9192 foreach( $wgContLang->getSpecialPageAliases() as $page => $aliases ) {
92 - if( !array_key_exists( $page, SpecialPage::$mList ) ) # bug 20885
 93+ if( !array_key_exists( $page, SpecialPage::$mList ) ) {# bug 20885
9394 continue;
 95+ }
9496
9597 foreach( $aliases as $alias ) {
9698 $keys[$wgContLang->caseFold( $alias )] = $alias;
@@ -100,12 +102,14 @@
101103 $srchres = array();
102104 foreach( $keys as $pageKey => $page ) {
103105 if( $searchKey === '' || strpos( $pageKey, $searchKey ) === 0 ) {
104 - $srchres[] = Title::makeTitle( NS_SPECIAL, $page )->getPrefixedText();
 106+ $srchres[] = SpecialPage::getTitleFor( $page )->getPrefixedText();
105107 }
 108+
106109 if( count( $srchres ) >= $limit ) {
107110 break;
108111 }
109112 }
 113+
110114 return $srchres;
111115 }
112116

Follow-up revisions

RevisionCommit summaryAuthorDate
r83876Revert r67661 (change Title::makeTitle(NS_SPECIAL, $foo) to SpecialPage::getT...catrope10:03, 14 March 2011

Status & tagging log