10BC0 fix merge · symfony/symfony@3895acd · GitHub
[go: up one dir, main page]

Skip to content

Commit 3895acd

Browse files
fix merge
1 parent 3969948 commit 3895acd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Routing/Generator/UrlGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa
161161
$important = $token[5] ?? false;
162162

163163
if (!$optional || $important || !\array_key_exists($varName, $defaults) || (null !== $mergedParams[$varName] && (string) $mergedParams[$varName] !== (string) $defaults[$varName])) {
164-
// check requirement
165-
if (null !== $this->strictRequirements && !preg_match('#^'.$token[2].'$#'.(empty($token[4]) ? '' : 'u'), $mergedParams[$varName])) {
164+
// check requirement (while ignoring look-around patterns)
165+
if (null !== $this->strictRequirements && !preg_match('#^'.preg_replace('/\(\?(?:=|<=|!|<!)((?:[^()\\\\]+|\\\\.|\((?1)\))*)\)/', '', $token[2]).'$#i'.(empty($token[4]) ? '' : 'u'), $mergedParams[$token[3]])) {
166166
if ($this->strictRequirements) {
167167
throw new InvalidParameterException(strtr($message, ['{parameter}' => $varName, '{route}' => $name, '{expected}' => $token[2], '{given}' => $mergedParams[$varName]]));
168168
}

0 commit comments

Comments
 (0)
0