make sure the country code has only two characters, prevents 'default' as value

This commit is contained in:
David Remer 2020-10-21 08:58:02 +03:00
parent 9dc95c0e28
commit 8fbffbced0

View file

@ -704,6 +704,7 @@ class SmartButton implements SmartButtonInterface {
if (
defined( 'WP_DEBUG' ) && \WP_DEBUG && is_user_logged_in()
&& WC()->customer && WC()->customer->get_billing_country()
&& 2 === strlen( WC()->customer->get_billing_country() )
) {
$params['buyer-country'] = WC()->customer->get_billing_country();
}