From abb053b2775c9516432dc5713730a546efae236f Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Wed, 15 Mar 2017 15:36:43 -0300 Subject: [PATCH] Prevents combining empty arrays in WC_Payment_Token_Data_Store PHP 5.3 and 5.2 issue E_WARNING and return FALSE for empty arrays. --- includes/data-stores/class-wc-payment-token-data-store.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/data-stores/class-wc-payment-token-data-store.php b/includes/data-stores/class-wc-payment-token-data-store.php index 51615747c88..cc68cc98521 100644 --- a/includes/data-stores/class-wc-payment-token-data-store.php +++ b/includes/data-stores/class-wc-payment-token-data-store.php @@ -179,7 +179,7 @@ class WC_Payment_Token_Data_Store extends WC_Data_Store_WP implements WC_Payment $updated_props = array(); $extra_data_keys = $token->get_extra_data_keys(); - $meta_key_to_props = array_combine( $extra_data_keys, $extra_data_keys ); + $meta_key_to_props = ! empty( $extra_data_keys ) ? array_combine( $extra_data_keys, $extra_data_keys ) : array(); $props_to_update = $force ? $meta_key_to_props : $this->get_props_to_update( $token, $meta_key_to_props ); foreach ( $extra_data_keys as $key ) {