Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
Compiled PHP for customized route matching#4343
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
The second parameter of `rtrim()` is a character mask. By checking if `rtrim($pathinfo, '/contact') === ''`, `$pathinfo` could be any URL containing those characters and not only "/contact" which was configured as the route path, for example: $pathinfo = '/octocat'; var_dump(rtrim($pathinfo, '/contact') === ''); // bool(true)
book/routing.rst Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
it should be:if (0 === strpos($pathinfo, '/_profiler') (since this example is just copied verbatim from the generated cache file)
GeertDD commentedOct 20, 2014
Fine by me,@wouterj, as long as that erroneous use of |
This PR was submitted for the master branch but it was merged into the 2.4 branch instead (closes#4343).Discussion----------Compiled PHP for customized route matchingThe second parameter of `rtrim()` is a character mask. By checking if `rtrim($pathinfo, '/contact') === ''`, `$pathinfo` could be any URL containing those characters and not only "/contact" which was configured as the route path, for example: $pathinfo = '/octocat'; var_dump(rtrim($pathinfo, '/contact') === ''); // bool(true)Commits-------fb5e820 Compiled PHP for customized route matching
wouterj commentedOct 26, 2014
I'm sorry, I looked at the wrong code. I've tested the exact routing config of the documentation and it turns out |
The second parameter of
rtrim()is a character mask. By checking ifrtrim($pathinfo, '/contact') === '',$pathinfocould be any URL containing those characters and not only "/contact" which was configured as the route path, for example: