Merge pull request #5617 from enru/master
unslash order item meta key before updating in DB
This commit is contained in:
commit
eadf66a7d9
|
@ -164,12 +164,11 @@ class WC_Meta_Box_Order_Items {
|
|||
|
||||
foreach ( $meta_keys as $id => $meta_key ) {
|
||||
$meta_value = ( empty( $meta_values[ $id ] ) && ! is_numeric( $meta_values[ $id ] ) ) ? '' : $meta_values[ $id ];
|
||||
$meta_value = stripslashes( $meta_value );
|
||||
$wpdb->update(
|
||||
$wpdb->prefix . "woocommerce_order_itemmeta",
|
||||
array(
|
||||
'meta_key' => $meta_key,
|
||||
'meta_value' => $meta_value
|
||||
'meta_key' => wp_unslash($meta_key),
|
||||
'meta_value' => wp_unslash($meta_value)
|
||||
),
|
||||
array( 'meta_id' => $id ),
|
||||
array( '%s', '%s' ),
|
||||
|
@ -180,4 +179,4 @@ class WC_Meta_Box_Order_Items {
|
|||
// Update cart discount from item totals
|
||||
update_post_meta( $post_id, '_cart_discount', $subtotal - $total );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue