| Index: trunk/phase3/includes/SearchEngine.php |
| — | — | @@ -145,11 +145,11 @@ |
| 146 | 146 | # Perform the search and construct the results page |
| 147 | 147 | function showResults() |
| 148 | 148 | { |
| 149 | | - global $wgUser, $wgTitle, $wgOut, $wgLang, $wgDisableTextSearch; |
| 150 | | - global $wgInputEncoding; |
| | 149 | + global $wgUser, $wgTitle, $wgOut, $wgLang, $wgRequest; |
| | 150 | + global $wgDisableTextSearch, $wgInputEncoding; |
| 151 | 151 | $fname = "SearchEngine::showResults"; |
| 152 | 152 | |
| 153 | | - $search = $_REQUEST['search']; |
| | 153 | + $search = $wgRequest->getText( 'search' ); |
| 154 | 154 | |
| 155 | 155 | $powersearch = $this->powersearch(); /* Need side-effects here? */ |
| 156 | 156 | |
| — | — | @@ -418,10 +418,11 @@ |
| 419 | 419 | |
| 420 | 420 | function goResult() |
| 421 | 421 | { |
| 422 | | - global $wgOut, $wgDisableTextSearch; |
| | 422 | + global $wgOut, $wgRequest; |
| | 423 | + global $wgDisableTextSearch; |
| 423 | 424 | $fname = "SearchEngine::goResult"; |
| 424 | 425 | |
| 425 | | - $search = $_REQUEST['search']; |
| | 426 | + $search = $wgRequest->getText( "search" ); |
| 426 | 427 | |
| 427 | 428 | # First try to go to page as entered. |
| 428 | 429 | # |
| — | — | @@ -433,7 +434,8 @@ |
| 434 | 435 | return; |
| 435 | 436 | } |
| 436 | 437 | |
| 437 | | - if ( 0 != $t->getArticleID() ) { |
| | 438 | + # Exact match? No need to look further. |
| | 439 | + if ( $t->getNamespace() == NS_SPECIAL || 0 != $t->getArticleID() ) { |
| 438 | 440 | $wgOut->redirect( $t->getFullURL() ); |
| 439 | 441 | return; |
| 440 | 442 | } |