[Form] Check for normal integers. refs 0427b126c1

This commit is contained in:
Manuel de Ruiter 2011-11-12 00:58:46 +01:00
parent 970e2a2608
commit 462580c06f

View File

@ -142,15 +142,15 @@ class DateTimeToArrayTransformer extends BaseDateTimeTransformer
)); ));
} }
if (isset($value['month']) && !ctype_digit($value['month'])) { if (isset($value['month']) && !ctype_digit($value['month']) && !is_int($value['month'])) {
throw new TransformationFailedException('This month is invalid'); throw new TransformationFailedException('This month is invalid');
} }
if (isset($value['day']) && !ctype_digit($value['day'])) { if (isset($value['day']) && !ctype_digit($value['day']) && !is_int($value['day'])) {
throw new TransformationFailedException('This day is invalid'); throw new TransformationFailedException('This day is invalid');
} }
if (isset($value['year']) && !ctype_digit($value['year'])) { if (isset($value['year']) && !ctype_digit($value['year']) && !is_int($value['year'])) {
throw new TransformationFailedException('This year is invalid'); throw new TransformationFailedException('This year is invalid');
} }