jenkins-bot has submitted this change and it was merged.

Change subject: Const and better name for initial ip velocity flag
......................................................................


Const and better name for initial ip velocity flag

Bug: T136381
Change-Id: I5feb5cb3ce3ce531a8bd9f4474d8ea83b9291005
---
M extras/custom_filters/filters/ip_velocity/ip_velocity.body.php
1 file changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Cdentinger: Looks good to me, approved
  Awight: Looks good to me, approved
  jenkins-bot: Verified



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..18a88a9 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 {
 
+       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: merged
Gerrit-Change-Id: I5feb5cb3ce3ce531a8bd9f4474d8ea83b9291005
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: AndyRussG <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Cdentinger <[email protected]>
Gerrit-Reviewer: Ssmith <[email protected]>
Gerrit-Reviewer: XenoRyet <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to