From: Brion Vibber Date: Sun, 11 Apr 2004 05:28:11 +0000 (+0000) Subject: If asked to 'go' to a special: page title, jump directly there. Fix encoding of searc... X-Git-Tag: 1.3.0beta1~461 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=92050b837d8b4b99f465134270d5b804dd8041e8;p=lhc%2Fweb%2Fwiklou.git If asked to 'go' to a special: page title, jump directly there. Fix encoding of search requests for Esperanto --- diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index dd512e967c..d9dd183c93 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -145,11 +145,11 @@ class SearchEngine { # Perform the search and construct the results page function showResults() { - global $wgUser, $wgTitle, $wgOut, $wgLang, $wgDisableTextSearch; - global $wgInputEncoding; + global $wgUser, $wgTitle, $wgOut, $wgLang, $wgRequest; + global $wgDisableTextSearch, $wgInputEncoding; $fname = "SearchEngine::showResults"; - $search = $_REQUEST['search']; + $search = $wgRequest->getText( 'search' ); $powersearch = $this->powersearch(); /* Need side-effects here? */ @@ -418,10 +418,11 @@ class SearchEngine { function goResult() { - global $wgOut, $wgDisableTextSearch; + global $wgOut, $wgRequest; + global $wgDisableTextSearch; $fname = "SearchEngine::goResult"; - $search = $_REQUEST['search']; + $search = $wgRequest->getText( "search" ); # First try to go to page as entered. # @@ -433,7 +434,8 @@ class SearchEngine { return; } - if ( 0 != $t->getArticleID() ) { + # Exact match? No need to look further. + if ( $t->getNamespace() == NS_SPECIAL || 0 != $t->getArticleID() ) { $wgOut->redirect( $t->getFullURL() ); return; }