MediaWiki r3118 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r3117‎ | r3118 (on ViewVC)‎ | r3119 >
Date:05:28, 11 April 2004
Author:vibber
Status:old
Tags:
Comment:
If asked to 'go' to a special: page title, jump directly there. Fix encoding of search requests for Esperanto
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/SearchEngine.php
@@ -145,11 +145,11 @@
146146 # Perform the search and construct the results page
147147 function showResults()
148148 {
149 - global $wgUser, $wgTitle, $wgOut, $wgLang, $wgDisableTextSearch;
150 - global $wgInputEncoding;
 149+ global $wgUser, $wgTitle, $wgOut, $wgLang, $wgRequest;
 150+ global $wgDisableTextSearch, $wgInputEncoding;
151151 $fname = "SearchEngine::showResults";
152152
153 - $search = $_REQUEST['search'];
 153+ $search = $wgRequest->getText( 'search' );
154154
155155 $powersearch = $this->powersearch(); /* Need side-effects here? */
156156
@@ -418,10 +418,11 @@
419419
420420 function goResult()
421421 {
422 - global $wgOut, $wgDisableTextSearch;
 422+ global $wgOut, $wgRequest;
 423+ global $wgDisableTextSearch;
423424 $fname = "SearchEngine::goResult";
424425
425 - $search = $_REQUEST['search'];
 426+ $search = $wgRequest->getText( "search" );
426427
427428 # First try to go to page as entered.
428429 #
@@ -433,7 +434,8 @@
434435 return;
435436 }
436437
437 - if ( 0 != $t->getArticleID() ) {
 438+ # Exact match? No need to look further.
 439+ if ( $t->getNamespace() == NS_SPECIAL || 0 != $t->getArticleID() ) {
438440 $wgOut->redirect( $t->getFullURL() );
439441 return;
440442 }

Status & tagging log

  • 01:56, 13 October 2010 ^demon (Talk | contribs) changed the status of r3118 [removed: new added: old]
Personal tools
Namespaces

Variants
Views
Actions
Navigation
Support
Download
Development
Communication
Toolbox