Update src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php

Fix `preg_match` to work with older PCRE.
This commit is contained in:
Joseph Bielawski 2012-12-20 10:02:06 +01:00
parent d97829e8a8
commit 2a2c46892c

View File

@ -160,14 +160,14 @@ class DateTimeToStringTransformer extends BaseDateTimeTransformer
// Check which of the date parts are present in the pattern
preg_match(
'/(' .
'(?<day>[djDl])|' .
'(?<month>[FMmn])|' .
'(?<year>[Yy])|' .
'(?<hour>[ghGH])|' .
'(?<minute>i)|' .
'(?<second>s)|' .
'(?<dayofyear>z)|' .
'(?<timestamp>U)|' .
'(?P<day>[djDl])|' .
'(?P<month>[FMmn])|' .
'(?P<year>[Yy])|' .
'(?P<hour>[ghGH])|' .
'(?P<minute>i)|' .
'(?P<second>s)|' .
'(?P<dayofyear>z)|' .
'(?P<timestamp>U)|' .
'[^djDlFMmnYyghGHiszU]' .
')*/',
$this->parseFormat,