MediaWiki fundraising/REL1_35
CurrencyCountryRule.php
Go to the documentation of this file.
1<?php
2
22 public static function isEnabled( $rule, $currency, $country ) {
23 $country = strtoupper( $country );
24 $currency = strtoupper( $currency );
25 $isEnabled = false;
26 if ( array_key_exists( $currency, $rule ) ) {
27 if ( !is_array( $rule[$currency] ) ) {
28 if ( $rule[$currency] === $country ) {
29 $isEnabled = true;
30 }
31 } else {
32 if ( empty( $rule[$currency] ) || in_array( $country, $rule[$currency] ) ) {
33 $isEnabled = true;
34 }
35 }
36 }
37 return $isEnabled;
38 }
39}
static isEnabled( $rule, $currency, $country)
Looks up whether a rule is enabled for a particular currency and country Example rules: $use3ds = [ '...