Ejegg has uploaded a new change for review.
https://gerrit.wikimedia.org/r/290990
Change subject: Const and better name for initial ip velocity flag
......................................................................
Const and better name for initial ip velocity flag
Change-Id: I5feb5cb3ce3ce531a8bd9f4474d8ea83b9291005
---
M extras/custom_filters/filters/ip_velocity/ip_velocity.body.php
1 file changed, 5 insertions(+), 3 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface
refs/changes/90/290990/1
diff --git a/extras/custom_filters/filters/ip_velocity/ip_velocity.body.php
b/extras/custom_filters/filters/ip_velocity/ip_velocity.body.php
index b03e1f5..e2a0c75 100644
--- a/extras/custom_filters/filters/ip_velocity/ip_velocity.body.php
+++ b/extras/custom_filters/filters/ip_velocity/ip_velocity.body.php
@@ -2,6 +2,8 @@
class Gateway_Extras_CustomFilters_IP_Velocity extends Gateway_Extras {
+ public const RAN_INITIAL = 'initial_ip_velocity_has_run';
+
/**
* Container for an instance of self
* @var Gateway_Extras_CustomFilters_IP_Velocity
@@ -170,7 +172,7 @@
return true;
}
if (
- $gateway_adapter->getRequest()->getSessionData(
'initialIPVelocity' ) &&
+ $gateway_adapter->getRequest()->getSessionData(
self::RAN_INITIAL ) &&
!$gateway_adapter->getRequest()->getSessionData(
'numAttempt' )
) {
// We're on the first attempt, already counted in
onInitialFilter
@@ -190,11 +192,11 @@
if ( !$gateway_adapter->getGlobal( 'EnableIPVelocityFilter' ) ){
return true;
}
- if ( $gateway_adapter->getRequest()->getSessionData(
'initialIPVelocity' ) ) {
+ if ( $gateway_adapter->getRequest()->getSessionData(
self::RAN_INITIAL ) ) {
return true;
}
- $gateway_adapter->getRequest()->setSessionData(
'initialIPVelocity', true );
+ $gateway_adapter->getRequest()->setSessionData(
self::RAN_INITIAL, true );
$gateway_adapter->debugarray[] = 'IP Velocity onFilter hook!';
return self::singleton( $gateway_adapter, $custom_filter_object
)->filter();
}
--
To view, visit https://gerrit.wikimedia.org/r/290990
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5feb5cb3ce3ce531a8bd9f4474d8ea83b9291005
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits