http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67661

Revision: 67661
Author:   siebrand
Date:     2010-06-08 19:36:44 +0000 (Tue, 08 Jun 2010)

Log Message:
-----------
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: trunk/phase3/includes/PrefixSearch.php
===================================================================
--- trunk/phase3/includes/PrefixSearch.php      2010-06-08 19:32:39 UTC (rev 
67660)
+++ trunk/phase3/includes/PrefixSearch.php      2010-06-08 19:36:44 UTC (rev 
67661)
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * PrefixSearch - Handles searching prefixes of titles and finding any page
  * names that match. Used largely by the OpenSearch implementation.
@@ -77,6 +76,7 @@
         */
        protected static function specialSearch( $search, $limit ) {
                global $wgContLang;
+
                $searchKey = $wgContLang->caseFold( $search );
 
                // Unlike SpecialPage itself, we want the canonical forms of 
both
@@ -87,9 +87,11 @@
                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 @@
                $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;
        }
 



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to