global $wgDisableTextSearch;
$fname = "SearchEngine::goResult";
- $search = $wgRequest->getText( "search" );
+ $search = trim( $wgRequest->getText( "search" ) );
- # First try to go to page as entered.
+ # Entering an IP address goes to the contributions page
+ if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $search ) ) {
+ $title = Title::makeTitle( NS_SPECIAL, "Contributions" );
+ $wgOut->redirect( $title->getFullUrl( "target=$search" ) );
+ return;
+ }
+
+ # Try to go to page as entered.
#
$t = Title::newFromText( $search );