r82851 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82850‎ | r82851 | r82852 >
Date:13:28, 26 February 2011
Author:ialex
Status:ok
Tags:
Comment:
Don't even try to get user's IP address if he has 'ipblock-exempt' right
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -1116,7 +1116,10 @@
11171117 $this->mAllowUsertalk = 0;
11181118
11191119 # Check if we are looking at an IP or a logged-in user
1120 - if ( $this->isIP( $this->getName() ) ) {
 1120+ if ( $this->isAllowed( 'ipblock-exempt' ) ) {
 1121+ # Exempt from all types of IP-block
 1122+ $ip = '';
 1123+ } elseif ( $this->isIP( $this->getName() ) ) {
11211124 $ip = $this->getName();
11221125 } else {
11231126 # Check if we are looking at the current user
@@ -1130,11 +1133,6 @@
11311134 }
11321135 }
11331136
1134 - if ( $this->isAllowed( 'ipblock-exempt' ) ) {
1135 - # Exempt from all types of IP-block
1136 - $ip = '';
1137 - }
1138 -
11391137 # User/IP blocking
11401138 $this->mBlock = new Block();
11411139 $this->mBlock->fromMaster( !$bFromSlave );

Status & tagging log