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

[Routing] fix URL generation with look-around requirements#27601

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

Merged
fabpot merged 1 commit intosymfony:3.4fromnasimnabavi:ticket_10548
Feb 21, 2019

Conversation

@nasimnabavi
Copy link
Contributor

QA
Branch?2.8 up to 4.1 for bug fixes
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#10548
LicenseMIT
Doc PR

If you have a non-catchable pattern in requirements like f.e. a positive lookahead (.+(?=/foo/)), the generator will not accept the parameter as the parameter itself cannot fulfil the requirement, but only matches in the context of the entire path.
This fix looks for lookAround in the path and ignores checking the requirements if any lookAround exists.

@nicolas-grekas
Copy link
Member

ping@schmittjoh since you had some interest into these also.

@schmittjoh
Copy link
Contributor

@nicolas-grekas , yeah, this is actually a pull-request from us.

I've talked with Nasim, and she has suggested a slightly different fix now. Instead of turning off the validation entirely for the variable, we just remove validation of the look-around parts. This has the advantage that the value itself is still validated.

@nicolas-grekasnicolas-grekas added this to the2.8 milestoneJun 15, 2018
@nasimnabavi
Copy link
ContributorAuthor

Comments are applied:

  • regEx is changed.
  • new test added

@fabpot
Copy link
Member

@nicolas-grekas@stof Ready for another review of this PR?

@stof
Copy link
Member

From a performance PoV, I think it would be better to perform this regex transformation at compile time, by adding a new (optional) index in the token (if it is not there, we would use the unmodified pattern). But this would probably require doing that change in master only, considering it as a new feature (which could be fine. the original issue#10548 was tagged as an enhancement, not as a bug).

@nicolas-grekasnicolas-grekas changed the title[Routing] lookAhead fixed[Routing] fix URL generation with look-ahead requirementsNov 25, 2018
@nicolas-grekasnicolas-grekas changed the title[Routing] fix URL generation with look-ahead requirements[Routing] fix URL generation with look-around requirementsNov 25, 2018
@nicolas-grekasnicolas-grekasforce-pushed theticket_10548 branch 3 times, most recently from9aa09e1 to4042e1bCompareNovember 25, 2018 09:52
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I just pushed some minor changes (manystrpos() are slower than a directpreg_replace() so I inlined the call). Let's merge this in 3.4: the perf impact is negligible (PCRE is fast as hell). Not worth a new token in master IMHO.

@nicolas-grekasnicolas-grekas modified the milestones:2.8,3.4Nov 26, 2018
@nicolas-grekasnicolas-grekasforce-pushed theticket_10548 branch 2 times, most recently from578eb1b to1e9c795CompareNovember 26, 2018 13:31
@fabpot
Copy link
Member

Thank you@nasimnabavi.

@fabpotfabpot merged commitc474451 intosymfony:3.4Feb 21, 2019
fabpot added a commit that referenced this pull requestFeb 21, 2019
… (nasimnabavi)This PR was merged into the 3.4 branch.Discussion----------[Routing] fix URL generation with look-around requirements| Q             | A| ------------- | ---| Branch?       | 2.8 up to 4.1 for bug fixes| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#10548| License       | MIT| Doc PR        |If you have a non-catchable pattern in requirements like f.e. a positive lookahead (.+(?=/foo/)), the generator will not accept the parameter as the parameter itself cannot fulfil the requirement, but only matches in the context of the entire path.This fix looks for lookAround in the path and ignores checking the requirements if any lookAround exists.Commits-------c474451 [Routing] fix URL generation with look-around requirements
This was referencedMar 3, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@stofstofstof requested changes

@fabpotfabpotfabpot approved these changes

+2 more reviewers

@schmittjohschmittjohschmittjoh left review comments

@TobionTobionTobion approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

7 participants

@nasimnabavi@nicolas-grekas@schmittjoh@fabpot@stof@Tobion@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp