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 // Check which of the date parts are present in the pattern
preg_match( preg_match(
'/(' . '/(' .
'(?<day>[djDl])|' . '(?P<day>[djDl])|' .
'(?<month>[FMmn])|' . '(?P<month>[FMmn])|' .
'(?<year>[Yy])|' . '(?P<year>[Yy])|' .
'(?<hour>[ghGH])|' . '(?P<hour>[ghGH])|' .
'(?<minute>i)|' . '(?P<minute>i)|' .
'(?<second>s)|' . '(?P<second>s)|' .
'(?<dayofyear>z)|' . '(?P<dayofyear>z)|' .
'(?<timestamp>U)|' . '(?P<timestamp>U)|' .
'[^djDlFMmnYyghGHiszU]' . '[^djDlFMmnYyghGHiszU]' .
')*/', ')*/',
$this->parseFormat, $this->parseFormat,