Skip to content

Commit 6f28fc2

Browse files
committed
merged branch stloyd/patch-1 (PR symfony#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.
2 parents 9e75df5 + 2a2c468 commit 6f28fc2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,14 @@ public function reverseTransform($value)
160160
// Check which of the date parts are present in the pattern
161161
preg_match(
162162
'/(' .
163-
'(?<day>[djDl])|' .
164-
'(?<month>[FMmn])|' .
165-
'(?<year>[Yy])|' .
166-
'(?<hour>[ghGH])|' .
167-
'(?<minute>i)|' .
168-
'(?<second>s)|' .
169-
'(?<dayofyear>z)|' .
170-
'(?<timestamp>U)|' .
163+
'(?P<day>[djDl])|' .
164+
'(?P<month>[FMmn])|' .
165+
'(?P<year>[Yy])|' .
166+
'(?P<hour>[ghGH])|' .
167+
'(?P<minute>i)|' .
168+
'(?P<second>s)|' .
169+
'(?P<dayofyear>z)|' .
170+
'(?P<timestamp>U)|' .
171171
'[^djDlFMmnYyghGHiszU]' .
172172
')*/',
173173
$this->parseFormat,

0 commit comments

Comments
 (0)