From: Reedy Date: Mon, 18 Mar 2019 22:17:50 +0000 (+0000) Subject: User::(get|is)Block*(): We don't need to prefix variables with their type… X-Git-Tag: 1.34.0-rc.0~2407^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=7a4f2663a78824804fa8b43a9f0460b428a68173 User::(get|is)Block*(): We don't need to prefix variables with their type… Change-Id: I38e10453051dd300217542de68daab352993b2a6 --- diff --git a/includes/user/User.php b/includes/user/User.php index fe15034c4e..1c5c9e8a40 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -1820,11 +1820,11 @@ class User implements IDBAccessObject, UserIdentity { /** * Get blocking information - * @param bool $bFromReplica Whether to check the replica DB first. + * @param bool $fromReplica Whether to check the replica DB first. * To improve performance, non-critical checks are done against replica DBs. * Check when actually saving should be done against master. */ - private function getBlockedStatus( $bFromReplica = true ) { + private function getBlockedStatus( $fromReplica = true ) { global $wgProxyWhitelist, $wgApplyIpBlocksToXff, $wgSoftBlockRanges; if ( $this->mBlockedby != -1 ) { @@ -1855,7 +1855,7 @@ class User implements IDBAccessObject, UserIdentity { } // User/IP blocking - $block = Block::newFromTarget( $this, $ip, !$bFromReplica ); + $block = Block::newFromTarget( $this, $ip, !$fromReplica ); // Cookie blocking if ( !$block instanceof Block ) { @@ -1891,7 +1891,7 @@ class User implements IDBAccessObject, UserIdentity { $xff = $this->getRequest()->getHeader( 'X-Forwarded-For' ); $xff = array_map( 'trim', explode( ',', $xff ) ); $xff = array_diff( $xff, [ $ip ] ); - $xffblocks = Block::getBlocksForIPList( $xff, $this->isAnon(), !$bFromReplica ); + $xffblocks = Block::getBlocksForIPList( $xff, $this->isAnon(), !$fromReplica ); $block = Block::chooseBlock( $xffblocks, $xff ); if ( $block instanceof Block ) { # Mangle the reason to alert the user that the block @@ -2263,23 +2263,23 @@ class User implements IDBAccessObject, UserIdentity { /** * Check if user is blocked * - * @param bool $bFromReplica Whether to check the replica DB instead of + * @param bool $fromReplica Whether to check the replica DB instead of * the master. Hacked from false due to horrible probs on site. * @return bool True if blocked, false otherwise */ - public function isBlocked( $bFromReplica = true ) { - return $this->getBlock( $bFromReplica ) instanceof Block && + public function isBlocked( $fromReplica = true ) { + return $this->getBlock( $fromReplica ) instanceof Block && $this->getBlock()->appliesToRight( 'edit' ); } /** * Get the block affecting the user, or null if the user is not blocked * - * @param bool $bFromReplica Whether to check the replica DB instead of the master + * @param bool $fromReplica Whether to check the replica DB instead of the master * @return Block|null */ - public function getBlock( $bFromReplica = true ) { - $this->getBlockedStatus( $bFromReplica ); + public function getBlock( $fromReplica = true ) { + $this->getBlockedStatus( $fromReplica ); return $this->mBlock instanceof Block ? $this->mBlock : null; }