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

Change subject: Don't use frontend classes from fraud filters
......................................................................


Don't use frontend classes from fraud filters

Bug: T141487
Change-Id: I46d4351253167b8ce121f589bafd4c4b354c84b1
---
M extras/custom_filters/custom_filters.body.php
M extras/custom_filters/filters/minfraud/minfraud.body.php
M gateway_common/GatewayPage.php
3 files changed, 8 insertions(+), 12 deletions(-)

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



diff --git a/extras/custom_filters/custom_filters.body.php 
b/extras/custom_filters/custom_filters.body.php
index ba3a89c..2b45757 100644
--- a/extras/custom_filters/custom_filters.body.php
+++ b/extras/custom_filters/custom_filters.body.php
@@ -38,7 +38,9 @@
 
                // load user action ranges and risk score               
                $this->action_ranges = $this->gateway_adapter->getGlobal( 
'CustomFiltersActionRanges' );
-               $this->risk_score = WmfFramework::getSessionValue( 
'risk_scores' );
+               if ( !$gateway_adapter->isBatchProcessor() ) {
+                       $this->risk_score = WmfFramework::getSessionValue( 
'risk_scores' );
+               }
                if ( !$this->risk_score ) {
                        $this->risk_score = array();
                } else {
@@ -148,8 +150,10 @@
                        $this->sendAntifraudMessage( $localAction, $score, 
$this->risk_score );
                }
 
-               // Always keep the stored scores up to date
-               WmfFramework::setSessionValue( 'risk_scores', $this->risk_score 
);
+               if ( !$this->gateway_adapter->isBatchProcessor() ) {
+                       // Always keep the stored scores up to date
+                       WmfFramework::setSessionValue( 'risk_scores', 
$this->risk_score );
+               }
 
                return TRUE;
        }
diff --git a/extras/custom_filters/filters/minfraud/minfraud.body.php 
b/extras/custom_filters/filters/minfraud/minfraud.body.php
index 0d1bbbc..009f96d 100644
--- a/extras/custom_filters/filters/minfraud/minfraud.body.php
+++ b/extras/custom_filters/filters/minfraud/minfraud.body.php
@@ -182,7 +182,7 @@
                }
 
                // fetch the array of country codes
-               $country_codes = GatewayPage::getCountries();
+               $country_codes = CountryCodes::getCountryCodes();
 
                // loop through the map and add pertinent values from $data to 
the hash
                foreach ( $map as $key => $value ) {
diff --git a/gateway_common/GatewayPage.php b/gateway_common/GatewayPage.php
index c7bc830..bd1383a 100644
--- a/gateway_common/GatewayPage.php
+++ b/gateway_common/GatewayPage.php
@@ -286,14 +286,6 @@
        }
 
        /**
-        * Fetch the array of iso country codes => country names
-        * @return array
-        */
-       public static function getCountries() {
-               return CountryCodes::getCountryCodes();
-       }
-
-       /**
         * Respond to a donation request
         */
        protected function handleDonationRequest() {

-- 
To view, visit https://gerrit.wikimedia.org/r/306853
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I46d4351253167b8ce121f589bafd4c4b354c84b1
Gerrit-PatchSet: 12
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
Gerrit-Reviewer: AndyRussG <[email protected]>
Gerrit-Reviewer: Cdentinger <[email protected]>
Gerrit-Reviewer: Ejegg <[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