Skip to content

Commit

Permalink
Check if product_type query arg is set before using
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsherman committed Jul 31, 2023
1 parent 479c4ed commit 144606f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/woocommerce/includes/class-wc-ajax.php
Expand Up @@ -611,7 +611,7 @@ public static function add_attribute() {
wp_die( -1 );
}

$product_type = sanitize_text_field( wp_unslash( $_POST['product_type'] ) );
$product_type = isset( $_POST['product_type'] ) ? sanitize_text_field( wp_unslash( $_POST['product_type'] ) ) : 'simple';

$i = absint( $_POST['i'] );
$metabox_class = array();
Expand Down

0 comments on commit 144606f

Please sign in to comment.