Clean before json_encode to ensure values are strings

#10937 @thenbrent
This commit is contained in:
Mike Jolley 2016-06-02 12:51:26 +01:00
parent 2108722027
commit d9db29a035
1 changed files with 2 additions and 2 deletions

View File

@ -184,8 +184,8 @@ class WC_Checkout {
'status' => apply_filters( 'woocommerce_default_order_status', 'pending' ),
'customer_id' => $this->customer_id,
'customer_note' => isset( $this->posted['order_comments'] ) ? $this->posted['order_comments'] : '',
'cart_hash' => md5( print_r( WC()->cart->get_cart_for_session(), true ) . WC()->cart->total ),
'created_via' => 'checkout'
'cart_hash' => md5( json_encode( wc_clean( WC()->cart->get_cart_for_session() ) ) . WC()->cart->total ),
'created_via' => 'checkout',
);
// Insert or update the post data