More strict COD method matching

Fixes #15606
This commit is contained in:
Mike Jolley 2017-06-14 12:17:28 +01:00
parent 66259ebff1
commit 55e9add8e5
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}