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
290290 */
291291 public static function validateInteger (IControl $ control ): bool
292292 {
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 );
297298 return true ;
298299 }
299300 return false ;
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ test(function () {
196196 Assert::same ('123.5 ' , $ control ->value );
197197
198198 $ control ->value = PHP_INT_MAX . PHP_INT_MAX ;
199- Assert::true (Validator::validateInteger ($ control ));
199+ Assert::false (Validator::validateInteger ($ control ));
200200 Assert::same (PHP_INT_MAX . PHP_INT_MAX , $ control ->value );
201201});
202202
You can’t perform that action at this time.
0 commit comments