Index: trunk/phase3/includes/PrefixSearch.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | 4 | * PrefixSearch - Handles searching prefixes of titles and finding any page |
6 | 5 | * names that match. Used largely by the OpenSearch implementation. |
— | — | @@ -77,6 +76,7 @@ |
78 | 77 | */ |
79 | 78 | protected static function specialSearch( $search, $limit ) { |
80 | 79 | global $wgContLang; |
| 80 | + |
81 | 81 | $searchKey = $wgContLang->caseFold( $search ); |
82 | 82 | |
83 | 83 | // Unlike SpecialPage itself, we want the canonical forms of both |
— | — | @@ -87,9 +87,11 @@ |
88 | 88 | foreach( array_keys( SpecialPage::$mList ) as $page ) { |
89 | 89 | $keys[$wgContLang->caseFold( $page )] = $page; |
90 | 90 | } |
| 91 | + |
91 | 92 | 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 |
93 | 94 | continue; |
| 95 | + } |
94 | 96 | |
95 | 97 | foreach( $aliases as $alias ) { |
96 | 98 | $keys[$wgContLang->caseFold( $alias )] = $alias; |
— | — | @@ -100,12 +102,14 @@ |
101 | 103 | $srchres = array(); |
102 | 104 | foreach( $keys as $pageKey => $page ) { |
103 | 105 | if( $searchKey === '' || strpos( $pageKey, $searchKey ) === 0 ) { |
104 | | - $srchres[] = Title::makeTitle( NS_SPECIAL, $page )->getPrefixedText(); |
| 106 | + $srchres[] = SpecialPage::getTitleFor( $page )->getPrefixedText(); |
105 | 107 | } |
| 108 | + |
106 | 109 | if( count( $srchres ) >= $limit ) { |
107 | 110 | break; |
108 | 111 | } |
109 | 112 | } |
| 113 | + |
110 | 114 | return $srchres; |
111 | 115 | } |
112 | 116 | |