Revert r32811 -- regression in search.
[lhc/web/wiklou.git] / includes / SpecialSearch.php
index 434ea33..b16ceb1 100644 (file)
@@ -142,13 +142,16 @@ class SpecialSearch {
                                return;
                        }
                        global $wgInputEncoding;
-                       $wgOut->addHTML( wfMsg( 'searchdisabled' ) );
-                       $wgOut->addHTML(
+                       $wgOut->addHTML( 
+                               Xml::openElement( 'fieldset' ) .
+                               Xml::element( 'legend', null, wfMsg( 'search-external' ) ) .
+                               Xml::element( 'p', array( 'class' => 'mw-searchdisabled' ), wfMsg( 'searchdisabled' ) ) .
                                wfMsg( 'googlesearch',
                                        htmlspecialchars( $term ),
                                        htmlspecialchars( $wgInputEncoding ),
                                        htmlspecialchars( wfMsg( 'searchbutton' ) )
-                               )
+                               ) .
+                               Xml::closeElement( 'fieldset' )
                        );
                        wfProfileOut( $fname );
                        return;
@@ -159,8 +162,10 @@ class SpecialSearch {
                $search = SearchEngine::create();
                $search->setLimitOffset( $this->limit, $this->offset );
                $search->setNamespaces( $this->namespaces );
-               $search->showRedirects = $this->searchRedirects;
-               $titleMatches = $search->searchTitle( $term );
+               $search->showRedirects = $this->searchRedirects;                
+               $rewritten = $search->replacePrefixes($term);
+               
+               $titleMatches = $search->searchTitle( $rewritten );
 
                // Sometimes the search engine knows there are too many hits
                if ($titleMatches instanceof SearchResultTooMany) {
@@ -170,7 +175,7 @@ class SpecialSearch {
                        wfProfileOut( $fname );
                        return;
                }
-               $textMatches = $search->searchText( $term );
+               $textMatches = $search->searchText( $rewritten );
                
                // did you mean...
                if($textMatches && $textMatches->hasSuggestion()){