Merge pull request #13571 from woocommerce/fix-13529

Check $_POST before trying to save order address inputs
This commit is contained in:
Mike Jolley 2017-03-13 17:47:21 +00:00 committed by GitHub
commit c80fed52d8
1 changed files with 8 additions and 0 deletions

View File

@ -479,6 +479,10 @@ class WC_Meta_Box_Order_Data {
$field['id'] = '_billing_' . $key;
}
if ( ! isset( $_POST[ $field['id'] ] ) ) {
continue;
}
if ( is_callable( array( $order, 'set_billing_' . $key ) ) ) {
$props[ 'billing_' . $key ] = wc_clean( $_POST[ $field['id'] ] );
} else {
@ -494,6 +498,10 @@ class WC_Meta_Box_Order_Data {
$field['id'] = '_shipping_' . $key;
}
if ( ! isset( $_POST[ $field['id'] ] ) ) {
continue;
}
if ( is_callable( array( $order, 'set_shipping_' . $key ) ) ) {
$props[ 'shipping_' . $key ] = wc_clean( $_POST[ $field['id'] ] );
} else {