8000 Merge pull request #2 from Tobion/patch-2 · rvdbogerd/symfony@a146156 · GitHub
[go: up one dir, main page]

Skip to content

Commit a146156

Browse files
committed
Merge pull request symfony#2 from Tobion/patch-2
remove logic that could not be triggered anyway
2 parents f7ea68f + 38802ea commit a146156

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,9 @@ private function getRouteMethods(Route $route)
214214
*/
215215
private function regexToApacheRegex($regex)
216216
{
217-
$delimiter = $regex[0];
218-
$regexPatternEnd = strrpos($regex, $delimiter);
219-
if (strlen($regex) < 2 || 0 === $regexPatternEnd) {
220-
throw new \LogicException('The route regex "%s" is invalid', $regex);
221-
}
222-
$regex = preg_replace('/\?<.+?>/', '', substr($regex, 1, $regexPatternEnd - 1));
217+
$regexPatternEnd = strrpos($regex, $regex[0]);
223218

224-
return $regex;
219+
return preg_replace('/\?<.+?>/', '', substr($regex, 1, $regexPatternEnd - 1));
225220
}
226221

227222
/**

0 commit comments

Comments
 (0)
0