This commit is contained in:
Javier Casares 2026-11-04 17:33:03 +00:00
commit 44e2366e16

View file

@ -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 ];
}