* (bug 11035) Add descriptive <title> to Special:Search
[lhc/web/wiklou.git] / includes / SpecialSearch.php
index 3fc8bab..5d64f35 100644 (file)
@@ -217,9 +217,15 @@ class SpecialSearch {
         */
        function setupPage( $term ) {
                global $wgOut;
-               $wgOut->setPageTitle( wfMsg( 'searchresults' ) );
-               $subtitlemsg = ( Title::newFromText($term) ? 'searchsubtitle' : 'searchsubtitleinvalid' );
-               $wgOut->setSubtitle( $wgOut->parse( wfMsg( $subtitlemsg, wfEscapeWikiText($term) ) ) );
+               if ( $term ) {
+                       $titlemsg = wfMsgHtml( 'searchresults-title', $term );
+               } else {
+                       // Direct call of Special:Search or empty search string
+                       $titlemsg = wfMsgHtml( 'search' );
+               }
+               $wgOut->setPageTitle( $titlemsg );
+               $subtitlemsg = ( Title::newFromText( $term ) ? 'searchsubtitle' : 'searchsubtitleinvalid' );
+               $wgOut->setSubtitle( $wgOut->parse( wfMsg( $subtitlemsg, wfEscapeWikiText( $term ) ) ) );
                $wgOut->setArticleRelated( false );
                $wgOut->setRobotpolicy( 'noindex,nofollow' );
        }