File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -290,10 +290,11 @@ public static function validateNumeric(IControl $control): bool
290
290
*/
291
291
public static function validateInteger (IControl $ control ): bool
292
292
{
293
- if (Validators::isNumericInt ($ value = $ control ->getValue ())) {
294
- if (!is_float ($ tmp = $ value * 1 )) { // bigint leave as string
295
- $ control ->setValue ($ tmp );
296
- }
293
+ if (
294
+ Validators::isNumericInt ($ value = $ control ->getValue ())
295
+ && !is_float ($ tmp = $ value * 1 ) // too big for int?
296
+ ) {
297
+ $ control ->setValue ($ tmp );
297
298
return true ;
298
299
}
299
300
return false ;
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ test(function () {
196
196
Assert::same ('123.5 ' , $ control ->value );
197
197
198
198
$ control ->value = PHP_INT_MAX . PHP_INT_MAX ;
199
- Assert::true (Validator::validateInteger ($ control ));
199
+ Assert::false (Validator::validateInteger ($ control ));
200
200
Assert::same (PHP_INT_MAX . PHP_INT_MAX , $ control ->value );
201
201
});
202
202
You can’t perform that action at this time.
0 commit comments