Merge "search: did you mean should always go to SERP"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 23 Jun 2016 15:22:24 +0000 (15:22 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 23 Jun 2016 15:22:25 +0000 (15:22 +0000)
1  2 
includes/specials/SpecialSearch.php

@@@ -485,7 -485,9 +485,9 @@@ class SpecialSearch extends SpecialPag
        protected function getDidYouMeanHtml( SearchResultSet $textMatches ) {
                # mirror Go/Search behavior of original request ..
                $params = [ 'search' => $textMatches->getSuggestionQuery() ];
-               if ( $this->fulltext != null ) {
+               if ( $this->fulltext === null ) {
+                       $params['fulltext'] = 'Search';
+               } else {
                        $params['fulltext'] = $this->fulltext;
                }
                $stParams = array_merge( $params, $this->powerSearchOptions() );
                // Search instead for '$orig'
  
                $params = [ 'search' => $textMatches->getQueryAfterRewrite() ];
-               if ( $this->fulltext != null ) {
+               if ( $this->fulltext === null ) {
+                       $params['fulltext'] = 'Search';
+               } else {
                        $params['fulltext'] = $this->fulltext;
                }
                $stParams = array_merge( $params, $this->powerSearchOptions() );
         * @return string
         */
        protected function searchProfileTabs( $term ) {
 -              $out = Xml::openElement( 'div', [ 'class' => 'mw-search-profile-tabs' ] );
 +              $out = Html::element( 'div', [ 'class' => 'visualClear' ] ) .
 +                      Xml::openElement( 'div', [ 'class' => 'mw-search-profile-tabs' ] );
  
                $bareterm = $term;
                if ( $this->startsWithImage( $term ) ) {
                                ->numParams( $this->offset + 1, $this->offset + $resultsShown, $totalNum )
                                ->numParams( $resultsShown )
                                ->parse();
 -                      $out .= Xml::tags( 'div', [ 'class' => 'results-info' ], $top ) .
 -                              Xml::element( 'div', [ 'style' => 'clear:both' ], '', false );
 +                      $out .= Xml::tags( 'div', [ 'class' => 'results-info' ], $top );
                }
  
                return $out;