Fix minor issues missed in patch review:
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 27 Mar 2005 01:28:03 +0000 (01:28 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 27 Mar 2005 01:28:03 +0000 (01:28 +0000)
* Use getDbkey(), not getTitle(), when constructing new titles
* Don't bother checking for existence of a user page on go; with the
namespace prefix it's pretty clear what's meant, and the inconsistent
behavior would be more confusing than illuminating.

includes/SearchEngine.php

index 6526de4..a49f8e5 100644 (file)
@@ -77,17 +77,15 @@ class SearchEngine {
                $title = Title::newFromText( $term );
 
                # Entering an IP address goes to the contributions page
-               if ( ( $title->getNameSpace() == NS_USER && User::isIP($title->getText() ) ) || User::isIP(trim($term)) ) {
-                       $t2 = Title::makeTitle( NS_SPECIAL, "Contributions/" . $title->getText() );
-                       return $t2;
+               if ( ( $title->getNamespace() == NS_USER && User::isIP($title->getText() ) )
+                       || User::isIP( trim( $term ) ) ) {
+                       return Title::makeTitle( NS_SPECIAL, "Contributions/" . $title->getDbkey() );
                }
 
 
                # Entering a user goes to the user page whether it's there or not
-               if ( $title->getNameSpace() == NS_USER ) {
-                       if (User::idFromName($title->getText())) {
-                               return $title;
-                       }
+               if ( $title->getNamespace() == NS_USER ) {
+                       return $title;
                }
                
                return NULL;