(bug 34873) List contributions of existing users that have invalid names
authorAaron Schulz <aaron@users.mediawiki.org>
Thu, 1 Mar 2012 22:10:12 +0000 (22:10 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Thu, 1 Mar 2012 22:10:12 +0000 (22:10 +0000)
includes/specials/SpecialContributions.php

index 35709d2..9f08cc5 100644 (file)
@@ -627,13 +627,14 @@ class ContribsPager extends ReverseChronologicalPager {
                        # @todo FIXME: Other groups may have 'bot' rights
                        $join_conds['user_groups'] = array( 'LEFT JOIN', "ug_user = rev_user AND ug_group = 'bot'" );
                } else {
-                       if ( IP::isIPAddress( $this->target ) ) {
+                       $uid = User::idFromName( $this->target );
+                       if ( $uid ) {
+                               $condition['rev_user'] = $uid;
+                               $index = 'user_timestamp';
+                       } else {
                                $condition['rev_user_text'] = $this->target;
                                $index = 'usertext_timestamp';
-                       } else {
-                               $condition['rev_user'] = User::idFromName( $this->target );
-                               $index = 'user_timestamp';
-                       }
+                       } 
                }
                if ( $this->deletedOnly ) {
                        $condition[] = "rev_deleted != '0'";