esc html sku

This commit is contained in:
Mike Jolley 2012-02-15 13:25:57 +00:00
parent bb741395fa
commit ced19c9421
2 changed files with 2 additions and 2 deletions

View File

@ -673,7 +673,7 @@ function process_product_meta_variable( $post_id ) {
endif;
// Update post meta
update_post_meta( $variation_id, '_sku', $variable_sku[$i] );
update_post_meta( $variation_id, '_sku', esc_html( $variable_sku[$i] ) );
update_post_meta( $variation_id, '_price', $variable_price[$i] );
update_post_meta( $variation_id, '_sale_price', $variable_sale_price[$i] );
update_post_meta( $variation_id, '_weight', $variable_weight[$i] );

View File

@ -509,7 +509,7 @@ function woocommerce_process_product_meta( $post_id, $post ) {
// Unique SKU
$sku = get_post_meta($post_id, '_sku', true);
$new_sku = stripslashes( $_POST['_sku'] );
$new_sku = esc_html(stripslashes( $_POST['_sku'] ));
if ($new_sku!==$sku) :
if ($new_sku && !empty($new_sku)) :
if (