Преглед на файлове

[Form] Check for normal integers. refs 0427b126c15a0a27cd7033375e30371ae6a4e516

Manuel de Ruiter преди 13 години
родител
ревизия
462580c06f
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php

+ 3 - 3
src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php

@@ -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');
         }
         }