Don't even try to get user's IP address if he has 'ipblock-exempt' right
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 26 Feb 2011 13:28:02 +0000 (13:28 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 26 Feb 2011 13:28:02 +0000 (13:28 +0000)
includes/User.php

index 6340815..4ae4042 100644 (file)
@@ -1116,7 +1116,10 @@ class User {
                $this->mAllowUsertalk = 0;
 
                # Check if we are looking at an IP or a logged-in user
-               if ( $this->isIP( $this->getName() ) ) {
+               if ( $this->isAllowed( 'ipblock-exempt' ) ) {
+                       # Exempt from all types of IP-block
+                       $ip = '';
+               } elseif ( $this->isIP( $this->getName() ) ) {
                        $ip = $this->getName();
                } else {
                        # Check if we are looking at the current user
@@ -1130,11 +1133,6 @@ class User {
                        }
                }
 
-               if ( $this->isAllowed( 'ipblock-exempt' ) ) {
-                       # Exempt from all types of IP-block
-                       $ip = '';
-               }
-
                # User/IP blocking
                $this->mBlock = new Block();
                $this->mBlock->fromMaster( !$bFromSlave );