SpecialSearch: Get title from one we already have on hand in the context
authorChad Horohoe <chadh@wikimedia.org>
Mon, 5 May 2014 16:26:40 +0000 (09:26 -0700)
committerKrinkle <krinklemail@gmail.com>
Mon, 5 May 2014 23:15:58 +0000 (23:15 +0000)
Change-Id: Id7e761ad4882ec5c5f9324644eca143b727b0ad9

includes/specials/SpecialSearch.php

index 6eee861..c2b5f9b 100644 (file)
@@ -259,8 +259,6 @@ class SpecialSearch extends SpecialPage {
 
                // did you mean... suggestions
                if ( $showSuggestion && $textMatches && !$textStatus && $textMatches->hasSuggestion() ) {
-                       $st = SpecialPage::getTitleFor( 'Search' );
-
                        # mirror Go/Search behavior of original request ..
                        $didYouMeanParams = array( 'search' => $textMatches->getSuggestionQuery() );
 
@@ -280,7 +278,7 @@ class SpecialSearch extends SpecialPage {
                        }
 
                        $suggestLink = Linker::linkKnown(
-                               $st,
+                               $this->getPageTitle(),
                                $suggestionSnippet,
                                array(),
                                $stParams
@@ -651,7 +649,6 @@ class SpecialSearch extends SpecialPage {
                // link to related articles if supported
                $related = '';
                if ( $result->hasRelated() ) {
-                       $st = SpecialPage::getTitleFor( 'Search' );
                        $stParams = array_merge(
                                $this->powerSearchOptions(),
                                array(
@@ -662,7 +659,7 @@ class SpecialSearch extends SpecialPage {
                        );
 
                        $related = ' -- ' . Linker::linkKnown(
-                               $st,
+                               $this->getPageTitle(),
                                $this->msg( 'search-relatedarticle' )->text(),
                                array(),
                                $stParams