merged branch stloyd/patch-1 (PR #6434)

This PR was merged into the master branch.

Commits
-------

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

Discussion
----------

[Form] BC change for `preg_match` and old PCRE versions.

Fix `preg_match` in `DateTimeToStringTransformer`  to work with older PCRE.
This commit is contained in:
Fabien Potencier 2012-12-20 10:48:41 +01:00
commit 6f28fc2414

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,