commit 8098010209fe4f589781eb9b9e117750ffba63b1
parent a6b36d5cee4e464233ec28cfc320b27a339338e4
Author: Christian Grothoff <christian@grothoff.org>
Date: Thu, 23 Feb 2023 15:02:29 +0100
-improve version checking
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git 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 */