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

[HttpFoundation] use brace-style regex delimiters#27152

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:2.7fromxabbuh:issue-27107
May 6, 2018

Conversation

@xabbuh
Copy link
Member

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#27107
LicenseMIT
Doc PR

@stof
Copy link
Member

stof commentedMay 4, 2018

Simpler solution: use{} as delimiters. These have a special meaning inside the regex already, so don't require extra quoting just because of being the delimiter. This is the strategy used in Composer.

{
self::$trustedHostPatterns =array_map(function ($hostPattern) {
returnsprintf('#%s#i',$hostPattern);
returnsprintf('#%s#i',preg_replace('/(?<!\\\\)#/','\\#',$hostPattern));

Choose a reason for hiding this comment

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

lets' use {} as@stof suggested

@xabbuhxabbuh changed the title[HttpFoundation] escape the regex delimiter character[HttpFoundation] use brace-style regex delimitersMay 6, 2018
@xabbuh
Copy link
MemberAuthor

Status: Needs Review

@xabbuh
Copy link
MemberAuthor

I have switched to using curly braces as suggested by@stof.

@fabpot
Copy link
Member

Thank you@xabbuh.

@fabpotfabpot merged commitae62d9b intosymfony:2.7May 6, 2018
fabpot added a commit that referenced this pull requestMay 6, 2018
This PR was merged into the 2.7 branch.Discussion----------[HttpFoundation] use brace-style regex delimiters| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#27107| License       | MIT| Doc PR        |Commits-------ae62d9b use brace-style regex delimiters
@xabbuhxabbuh deleted the issue-27107 branchMay 6, 2018 17:36
This was referencedMay 21, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

2.7

Development

Successfully merging this pull request may close these issues.

5 participants

@xabbuh@stof@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp