From 7a25e48b5ec82e3f8f364aa6d00061fb0c5496f9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 24 Apr 2004 07:48:07 +0000 Subject: [PATCH] Fix bug #903109: fuzzy search doesn't set up title & sidebar right, includes edit link for main page. --- includes/SearchEngine.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index 9115de3f6e..e40a788ad1 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -143,6 +143,15 @@ class SearchEngine { return $ret; } + function setupPage() { + global $wgOut; + $wgOut->setPageTitle( wfMsg( "searchresults" ) ); + $q = wfMsg( "searchquery", htmlspecialchars( $this->mUsertext ) ); + $wgOut->setSubtitle( $q ); + $wgOut->setArticleRelated( false ); + $wgOut->setRobotpolicy( "noindex,nofollow" ); + } + # Perform the search and construct the results page function showResults() { @@ -154,12 +163,8 @@ class SearchEngine { $powersearch = $this->powersearch(); /* Need side-effects here? */ - $wgOut->setPageTitle( wfMsg( "searchresults" ) ); - $q = wfMsg( "searchquery", htmlspecialchars( $this->mUsertext ) ); - $wgOut->setSubtitle( $q ); - $wgOut->setArticleRelated( false ); - $wgOut->setRobotpolicy( "noindex,nofollow" ); - + $this->setupPage(); + $sk = $wgUser->getSkin(); $header = wfMsg( "searchresulttext", $sk->makeKnownLink( wfMsg( "searchhelppage" ), wfMsg( "searchingwikipedia" ) ) ); @@ -485,6 +490,9 @@ class SearchEngine { /* static */ function doFuzzyTitleSearch( $search, $namespace ){ global $wgLang, $wgOut; + + $this->setupPage(); + $sstr = ucfirst($search); $sstr = str_replace(" ", "_", $sstr); $fuzzymatches = SearchEngine::fuzzyTitles( $sstr, $namespace ); -- 2.20.1