Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
GeertDD wants to merge2 commits intosymfony:masterfromGeertDD:patch-1
Closed

Compiled PHP for customized route matching#4343

GeertDD wants to merge2 commits intosymfony:masterfromGeertDD:patch-1

Conversation

@GeertDD
Copy link
Contributor

The second parameter ofrtrim() is a character mask. By checking ifrtrim($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)

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)
Copy link
Member

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
Copy link
ContributorAuthor

Fine by me,@wouterj, as long as that erroneous use ofrtrim() disappears. Updated tostrpos() now.

wouterj added a commit that referenced this pull requestOct 26, 2014
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
Copy link
Member

I'm sorry, I looked at the wrong code. I've tested the exact routing config of the documentation and it turns out=== was indeed used instead ofstrpos. I've merged your PR and reverted the second commit in3d88312 Thanks for submitting this fix!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@GeertDD@wouterj

[8]ページ先頭

©2009-2025 Movatter.jp