Niharika29 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/330890 )
Change subject: Replace block trigger string by bool to indicate whether it was a cookie block ...................................................................... Replace block trigger string by bool to indicate whether it was a cookie block Bug: T146230 Change-Id: Ie771f29645c19cd4ae4c038a1ee7d554819a2f00 --- M includes/user/User.php 1 file changed, 6 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/90/330890/1 diff --git a/includes/user/User.php b/includes/user/User.php index 562f0d1..f4f87e7 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -300,10 +300,8 @@ /** @var integer User::READ_* constant bitfield used to load data */ protected $queryFlagsUsed = self::READ_NORMAL; - /** @var string Indicates type of block (used for eventlogging) - * Permitted values: 'cookie-block', 'proxy-block', 'openproxy-block', 'xff-block' - */ - public $blockTrigger = false; + /** @var bool Indicates whether it was a cookie block (used for eventlogging) */ + public $cookieBlock = false; public static $idCacheByName = []; @@ -1629,7 +1627,7 @@ if ( $blockIsValid && $useBlockCookie ) { // Use the block. $block = $tmpBlock; - $this->blockTrigger = 'cookie-block'; + $this->cookieBlock = true; } else { // If the block is not valid, clear the block cookie (but don't delete it, // because it needs to be cleared from LocalStorage as well and an empty string @@ -1649,7 +1647,7 @@ 'address' => $ip, 'systemBlock' => 'proxy', ] ); - $this->blockTrigger = 'proxy-block'; + $this->cookieBlock = false; } elseif ( $this->isAnon() && $this->isDnsBlacklisted( $ip ) ) { $block = new Block( [ 'byText' => wfMessage( 'sorbs' )->text(), @@ -1657,7 +1655,7 @@ 'address' => $ip, 'systemBlock' => 'dnsbl', ] ); - $this->blockTrigger = 'openproxy-block'; + $this->cookieBlock = false; } } @@ -1676,7 +1674,7 @@ # Mangle the reason to alert the user that the block # originated from matching the X-Forwarded-For header. $block->mReason = wfMessage( 'xffblockreason', $block->mReason )->text(); - $this->blockTrigger = 'xff-block'; + $this->cookieBlock = false; } } -- To view, visit https://gerrit.wikimedia.org/r/330890 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie771f29645c19cd4ae4c038a1ee7d554819a2f00 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Niharika29 <nko...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits