From: Brion Vibber Date: Sun, 15 Aug 2004 05:05:56 +0000 (+0000) Subject: Show the search terms as given instead of the filtered terms in the subtitle. X-Git-Tag: 1.5.0alpha1~2340 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=c079aeeafc393990601c3389846c6e5bd77621f1;p=lhc%2Fweb%2Fwiklou.git Show the search terms as given instead of the filtered terms in the subtitle. Part of the fix for Bug 54: go-search for non-existing page in a namespace returns broken new-edit URL http://bugzilla.wikipedia.org/show_bug.cgi?id=54 --- diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index 4e64287c29..4e01ee71ab 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -2,7 +2,7 @@ # See search.doc class SearchEngine { - /* private */ var $mUsertext, $mSearchterms; + /* private */ var $mRawtext, $mUsertext, $mSearchterms; /* private */ var $mTitlecond, $mTextcond; var $doSearchRedirects = true; @@ -18,6 +18,7 @@ class SearchEngine { global $wgDBmysql4; $lc = SearchEngine::legalSearchChars() . "()"; if( $wgDBmysql4 ) $lc .= "\"~<>*+-"; + $this->mRawtext = $text; $this->mUsertext = trim( preg_replace( "/[^{$lc}]/", " ", $text ) ); $this->mSearchterms = array(); $this->mStrictMatching = true; # Google-style, add '+' on all terms @@ -146,7 +147,7 @@ class SearchEngine { function setupPage() { global $wgOut; $wgOut->setPageTitle( wfMsg( "searchresults" ) ); - $q = wfMsg( "searchquery", htmlspecialchars( $this->mUsertext ) ); + $q = wfMsg( "searchquery", htmlspecialchars( $this->mRawtext ) ); $wgOut->setSubtitle( $q ); $wgOut->setArticleRelated( false ); $wgOut->setRobotpolicy( "noindex,nofollow" ); @@ -476,7 +477,7 @@ class SearchEngine { } # No match, generate an edit URL - $t = Title::newFromText( $wgRequest->getText( "search" ) ); + $t = Title::newFromText( $this->mRawtext ); # If the feature is enabled, go straight to the edit page if ( $wgGoToEdit ) {