8000 [Routing] Optimised dumped router matcher, prevent unneeded function calls. by frankdejonge · Pull Request #21755 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Routing] Optimised dumped router matcher, prevent unneeded function calls. #21755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Closed
Prev Previous commit
Next Next commit
Fixed CS
  • Loading branch information
frankdejonge committed Feb 24, 2017
commit 0d69cfec36e87a5b3d38b580b77129466e3f7c4d
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren

if (!count($compiledRoute->getPathVariables()) && false !== preg_match('#^(.)\^(?P<url>.*?)\$\1#'.(substr($regex, -1) === 'u' ? 'u' : ''), $regex, $m)) {
if ($supportsTrailingSlash && substr($m['url'], -1) === '/') {
$conditions[] = sprintf("\$trimmedPathinfo === %s", var_export(rtrim(str_replace('\\', '', $m['url']), '/'), true));
$conditions[] = sprintf('$trimmedPathinfo === %s', var_export(rtrim(str_replace('\\', '', $m['url']), '/'), true));
$hasTrailingSlash = true;
} else {
$conditions[] = sprintf('$pathinfo === %s', var_export(str_replace('\\', '', $m['url']), true));
Expand Down
0