Don't magically make MediaWiki\Widget classes infusable
[lhc/web/wiklou.git] / includes / specials / SpecialSearch.php
index 36ea983..20dbfd1 100644 (file)
@@ -485,7 +485,9 @@ class SpecialSearch extends SpecialPage {
        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() );
@@ -519,7 +521,9 @@ class SpecialSearch extends SpecialPage {
                // 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() );
@@ -716,7 +720,7 @@ class SpecialSearch extends SpecialPage {
 
                $out .= "<ul class='mw-search-results'>\n";
                while ( $result ) {
-                       $out .= $this->showHit( $result, $terms, ++$pos );
+                       $out .= $this->showHit( $result, $terms, $pos++ );
                        $result = $matches->next();
                }
                $out .= "</ul>\n";
@@ -1240,6 +1244,7 @@ class SpecialSearch extends SpecialPage {
                        'autofocus' => trim( $term ) === '',
                        'value' => $term,
                        'dataLocation' => 'content',
+                       'infusable' => true,
                ] );
 
                $layout = new OOUI\ActionFieldLayout( $searchWidget, new OOUI\ButtonInputWidget( [