diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-02-23 15:02:29 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-02-23 15:02:29 +0100 |
commit | 8098010209fe4f589781eb9b9e117750ffba63b1 (patch) | |
tree | 5fd36cd39bec496bce38164f336dec8dec33f8ec | |
parent | a6b36d5cee4e464233ec28cfc320b27a339338e4 (diff) | |
download | gnu-taler-payment-for-woocommerce-8098010209fe4f589781eb9b9e117750ffba63b1.tar.gz gnu-taler-payment-for-woocommerce-8098010209fe4f589781eb9b9e117750ffba63b1.tar.bz2 gnu-taler-payment-for-woocommerce-8098010209fe4f589781eb9b9e117750ffba63b1.zip |
-improve version checking
-rw-r--r-- | class-wc-gnutaler-gateway.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/class-wc-gnutaler-gateway.php b/class-wc-gnutaler-gateway.php index 940cc1a..1305479 100644 --- a/class-wc-gnutaler-gateway.php +++ b/class-wc-gnutaler-gateway.php @@ -42,7 +42,7 @@ define( 'GNU_TALER_MERCHANT_PROTOCOL_CURRENT', 3 ); /** * How many merchant protocol versions are we backwards compatible with? */ -define( 'GNU_TALER_MERCHANT_PROTOCOL_AGE', 2 ); +define( 'GNU_TALER_MERCHANT_PROTOCOL_AGE', 0 ); require_once ABSPATH . 'wp-admin/includes/plugin.php'; @@ -549,7 +549,8 @@ function gnutaler_init_gateway_class() { $age = $ver[2]; if ( ( ! is_numeric( $current ) ) || ( ! is_numeric( $revision ) ) - || ( ! is_numeric( $age ) ) + || ( ! is_numeric( $age ) + || ( $age > $current ) ) ) { $this->error( sprintf( @@ -583,7 +584,8 @@ function gnutaler_init_gateway_class() { return false; } $currency = $info['currency']; - if ( ( ! is_null( $ecurrency ) ) && ( 0 !== strcasecmp( $currency, $ecurrency ) ) ) { + if ( ( ! is_null( $ecurrency ) ) && + ( 0 !== strcasecmp( $currency, $ecurrency ) ) ) { $this->error( sprintf( /* translators: first placeholder is the Taler backend currency, second the expected currency from WooCommerce */ |