Skip to content

Commit 9b97a83

Browse files
committed
Fix removing leading backslash in types
1 parent 3da250a commit 9b97a83

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Twig/Extension/ReflectionExtension.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ public function getFilters()
6363
'/\), /',
6464
'/, \(/',
6565
'/^\((.*)\)$/',
66-
'/(?:^\\\\)|(?:[^_a-zA-Z])(\\\\)/',
66+
'/(?<=[(<|&])\\\\/',
67+
'/^\\\\/'
6768
],
68-
['${1}', '<', '>', ', ', ', ', '${1}', ''],
69+
['${1}', '<', '>', ', ', ', ', '${1}', '', ''],
6970
(string)$type
7071
);
7172
}),

0 commit comments

Comments
 (0)