v1.2.4
This commit is contained in:
parent
5cd5900111
commit
44e2366e16
1 changed files with 97 additions and 24 deletions
|
|
@ -208,7 +208,10 @@ if ( ! class_exists( 'AI_Translator_Settings' ) ) {
|
|||
foreach ( self::DEFAULTS as $key => $default ) {
|
||||
if ( array_key_exists( $key, $settings ) ) {
|
||||
if ( is_int( $default ) ) {
|
||||
$normalized[ $key ] = (int) $settings[ $key ];
|
||||
$value = $settings[ $key ];
|
||||
// Reject non-numeric input instead of casting it: garbage
|
||||
// falls back to the schema default.
|
||||
$normalized[ $key ] = is_numeric( $value ) ? (int) $value : $default;
|
||||
} else {
|
||||
$normalized[ $key ] = (bool) $settings[ $key ];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue