From 55e9add8e5a4e472521ffe4409fbcbc321891e89 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 14 Jun 2017 12:17:28 +0100 Subject: [PATCH] More strict COD method matching Fixes #15606 --- includes/gateways/cod/class-wc-gateway-cod.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/gateways/cod/class-wc-gateway-cod.php b/includes/gateways/cod/class-wc-gateway-cod.php index 7091f143ed8..37867bc8f19 100644 --- a/includes/gateways/cod/class-wc-gateway-cod.php +++ b/includes/gateways/cod/class-wc-gateway-cod.php @@ -178,10 +178,14 @@ class WC_Gateway_COD extends WC_Payment_Gateway { return false; } + if ( strstr( $check_method, ':' ) ) { + $check_method = current( explode( ':', $check_method ) ); + } + $found = false; foreach ( $this->enable_for_methods as $method_id ) { - if ( strpos( $check_method, $method_id ) === 0 ) { + if ( $check_method === $method_id ) { $found = true; break; }