Skip to content

Commit a146156

Browse files
committed
Merge pull request #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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy