[Form] simplified previous merge

This commit is contained in:
Fabien Potencier 2011-11-11 21:49:47 +01:00
parent 7475a3924c
commit 3922fb839a

View File

@ -142,7 +142,7 @@ class DateTimeToArrayTransformer extends BaseDateTimeTransformer
));
}
if (preg_match( '/^\d*$/', $value['month'] . $value['day'] . $value['year']) === 0) {
if (!ctype_digit($value['month'].$value['day'].$value['year'])) {
throw new TransformationFailedException('This is an invalid date');
}