Clean the SKU, prevents variations breaking when " was saved

@coenjacobs / me for .15
This commit is contained in:
Mike Jolley 2013-10-14 11:15:44 +01:00
parent cc397a89d5
commit dc6574b9e9
1 changed files with 2 additions and 2 deletions

View File

@ -968,8 +968,8 @@ class WC_Meta_Box_Product_Data {
wp_set_object_terms( $post_id, $product_shipping_class, 'product_shipping_class');
// Unique SKU
$sku = get_post_meta($post_id, '_sku', true);
$new_sku = esc_html( trim( stripslashes( $_POST['_sku'] ) ) );
$sku = get_post_meta( $post_id, '_sku', true );
$new_sku = woocommerce_clean( stripslashes( $_POST['_sku'] ) );
if ( $new_sku == '' ) {
update_post_meta( $post_id, '_sku', '' );