Special:Watchlist: Add user preference to "Show last" options, fix float comparison
[lhc/web/wiklou.git] / includes / specials / SpecialLinkSearch.php
index 67683f2..ca89776 100644 (file)
@@ -68,10 +68,9 @@ class LinkSearchPage extends QueryPage {
         * This allows for dependency injection even though we don't control object creation.
         */
        private function initServices() {
-               global $wgLanguageCode;
+               global $wgContLang;
                if ( !$this->linkRenderer ) {
-                       $lang = Language::factory( $wgLanguageCode );
-                       $titleFormatter = new MediaWikiTitleCodec( $lang, GenderCache::singleton() );
+                       $titleFormatter = new MediaWikiTitleCodec( $wgContLang, GenderCache::singleton() );
                        $this->linkRenderer = new MediaWikiPageLinkRenderer( $titleFormatter );
                }
        }
@@ -80,7 +79,7 @@ class LinkSearchPage extends QueryPage {
                return false;
        }
 
-       function execute( $par ) {
+       public function execute( $par ) {
                $this->initServices();
 
                $this->setHeaders();
@@ -91,7 +90,7 @@ class LinkSearchPage extends QueryPage {
 
                $request = $this->getRequest();
                $target = $request->getVal( 'target', $par );
-               $namespace = $request->getIntOrNull( 'namespace', null );
+               $namespace = $request->getIntOrNull( 'namespace' );
 
                $protocols_list = array();
                foreach ( $this->getConfig()->get( 'UrlProtocols' ) as $prot ) {
@@ -218,7 +217,7 @@ class LinkSearchPage extends QueryPage {
                return $params;
        }
 
-       function getQueryInfo() {
+       public function getQueryInfo() {
                $dbr = wfGetDB( DB_SLAVE );
                // strip everything past first wildcard, so that
                // index-based-only lookup would be done