Awight has uploaded a new change for review.
https://gerrit.wikimedia.org/r/304582
Change subject: Fix dangling references to GatewayType::getRequest
......................................................................
Fix dangling references to GatewayType::getRequest
Change-Id: I1ebe1952df6bd05d64b4ae33fe9d7f25451fa3ce
---
M extras/custom_filters/filters/ip_velocity/ip_velocity.body.php
M extras/session_velocity/session_velocity.body.php
2 files changed, 7 insertions(+), 7 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface
refs/changes/82/304582/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 18a88a9..baa9362 100644
--- a/extras/custom_filters/filters/ip_velocity/ip_velocity.body.php
+++ b/extras/custom_filters/filters/ip_velocity/ip_velocity.body.php
@@ -171,9 +171,8 @@
if ( !$gateway_adapter->getGlobal( 'EnableIPVelocityFilter' ) ){
return true;
}
- if (
- $gateway_adapter->getRequest()->getSessionData(
self::RAN_INITIAL ) &&
- !$gateway_adapter->getRequest()->getSessionData(
'numAttempt' )
+ if ( WmfFramework::getSessionValue( self::RAN_INITIAL )
+ && !WmfFramework::getSessionValue( 'numAttempt' )
) {
// We're on the first attempt, already counted in
onInitialFilter
return true;
@@ -192,11 +191,11 @@
if ( !$gateway_adapter->getGlobal( 'EnableIPVelocityFilter' ) ){
return true;
}
- if ( $gateway_adapter->getRequest()->getSessionData(
self::RAN_INITIAL ) ) {
+ if ( WmfFramework::getSessionValue( self::RAN_INITIAL ) ) {
return true;
}
- $gateway_adapter->getRequest()->setSessionData(
self::RAN_INITIAL, true );
+ WmfFramework::setSessionValue( self::RAN_INITIAL, true );
$gateway_adapter->debugarray[] = 'IP Velocity onFilter hook!';
return self::singleton( $gateway_adapter, $custom_filter_object
)->filter();
}
@@ -214,6 +213,7 @@
Gateway_Extras_CustomFilters $custom_filter_object = null
) {
+ # FIXME: Why always construct a new object if we're batch
processing?
if ( !self::$instance || $gateway_adapter->isBatchProcessor() )
{
self::$instance = new self( $gateway_adapter,
$custom_filter_object );
}
diff --git a/extras/session_velocity/session_velocity.body.php
b/extras/session_velocity/session_velocity.body.php
index 8ea9561..6ab5e17 100644
--- a/extras/session_velocity/session_velocity.body.php
+++ b/extras/session_velocity/session_velocity.body.php
@@ -99,7 +99,7 @@
$multiplier = $this->getVar( 'Multiplier', $transaction );
// Initialize the filter
- $sessionData =
$this->gateway_adapter->getRequest()->getSessionData( self::SESS_ROOT );
+ $sessionData = WmfFramework::getSessionValue( self::SESS_ROOT );
if ( !is_array( $sessionData ) ) {
$sessionData = array();
}
@@ -129,7 +129,7 @@
}
// Store the results
- $this->gateway_adapter->getRequest()->setSessionData(
self::SESS_ROOT, $sessionData );
+ WmfFramework::setSessionValue( self::SESS_ROOT, $sessionData );
// Analyze the filter results
if ( $score >= $threshold ) {
--
To view, visit https://gerrit.wikimedia.org/r/304582
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ebe1952df6bd05d64b4ae33fe9d7f25451fa3ce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits