Do not use strict comparison when doing in_array on select settings as wp_unslash on the raw_value will return a string that fails comparison with int values.

This commit is contained in:
Gerhard Potgieter 2017-12-15 13:21:01 +02:00
parent 650faf6450
commit 30398a65f1
1 changed files with 1 additions and 1 deletions

View File

@ -733,7 +733,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
break;
}
$default = ( empty( $option['default'] ) ? $allowed_values[0] : $option['default'] );
$value = in_array( $raw_value, $allowed_values, true ) ? $raw_value : $default;
$value = in_array( $raw_value, $allowed_values ) ? $raw_value : $default;
break;
default:
$value = wc_clean( $raw_value );