File tree 1 file changed +4
-4
lines changed
src/Symfony/Component/Locale/Stub/DateFormat
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -175,11 +175,11 @@ public function getReverseMatchingRegExp($pattern)
175
175
{
176
176
$ that = $ this ;
177
177
178
- // $escapedPattern = preg_quote($pattern, '/');
178
+ $ escapedPattern = preg_quote ($ pattern , '/ ' );
179
179
180
- // ICU 4.8 recognizes slash ("/") in a value to be parsed as a dash ("-") when parsing a value that
181
- // TODO: how to escape the regex metachars and still recognize "/" as "-" and vice-versa?
182
- $ escapedPattern = preg_replace ('/\-|\// ' , '[\/\-] ' , $ pattern );
180
+ // ICU 4.8 recognizes slash ("/") in a value to be parsed as a dash ("-") and vice-versa
181
+ // when parsing a date/time value
182
+ $ escapedPattern = preg_replace ('/ \\ \[\ -|\/] / ' , '[\/\-] ' , $ escapedPattern );
183
183
184
184
$ reverseMatchingRegExp = preg_replace_callback ($ this ->regExp , function ($ matches ) use ($ that ) {
185
185
$ length = strlen ($ matches [0 ]);
You can’t perform that action at this time.
0 commit comments