From 042585fb9d7f11103fff5ca41bac8aabc90add0b Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Tue, 8 Jun 2010 19:36:44 +0000 Subject: [PATCH] Replace Title::makeTitle[Safe]( NS_SPECIAL, 'x' ) with SpecialPage::getTitleFor ( 'x' ) And a few other minor changes. --- includes/PrefixSearch.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/PrefixSearch.php b/includes/PrefixSearch.php index 930b29d456..e251ee684e 100644 --- a/includes/PrefixSearch.php +++ b/includes/PrefixSearch.php @@ -1,5 +1,4 @@ caseFold( $search ); // Unlike SpecialPage itself, we want the canonical forms of both @@ -87,9 +87,11 @@ class PrefixSearch { foreach( array_keys( SpecialPage::$mList ) as $page ) { $keys[$wgContLang->caseFold( $page )] = $page; } + foreach( $wgContLang->getSpecialPageAliases() as $page => $aliases ) { - if( !array_key_exists( $page, SpecialPage::$mList ) ) # bug 20885 + if( !array_key_exists( $page, SpecialPage::$mList ) ) {# bug 20885 continue; + } foreach( $aliases as $alias ) { $keys[$wgContLang->caseFold( $alias )] = $alias; @@ -100,12 +102,14 @@ class PrefixSearch { $srchres = array(); foreach( $keys as $pageKey => $page ) { if( $searchKey === '' || strpos( $pageKey, $searchKey ) === 0 ) { - $srchres[] = Title::makeTitle( NS_SPECIAL, $page )->getPrefixedText(); + $srchres[] = SpecialPage::getTitleFor( $page )->getPrefixedText(); } + if( count( $srchres ) >= $limit ) { break; } } + return $srchres; } -- 2.20.1