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] IpUtils::checkIp4() should allow/0 networks#14690

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

Conversation

@zerkms
Copy link
Contributor

QA
Bug fix?yes
New feature?no
BC breaks?yes
Deprecations?no
Tests pass?yes
Fixed tickets#14674
LicenseMIT

Technically it's a breaking change, since the result of the

IpUtils::checkIp4('1.2.3.4', '0.0.0.0/0')

call wasfalse nowtrue.

Practically - no one should ever relied on this since it's simply wrong

@dosten
Copy link
Contributor

This looks wrong,256.256.256/0 returnstrue

@zerkms
Copy link
ContributorAuthor

@dosten that's a good catch, fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

0 === $netmask to keep consistency with other places.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@dosten

'0' === $netmask then? (it's a string)

Copy link
Contributor

Choose a reason for hiding this comment

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

The only address allowed to have a /0 netmask is 0.0.0.0. So this check must be:0 === $netmask && '0.0.0.0' === $address. Please don't cast 0 as string, do0, don't'0'.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@dosten I do not cast anything - it's a string initially, please look carefully at the code

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, cast is not the word :) i say:0 === $netmask instead of'0' === $netmask

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@dosten you cannot do that,$netmask is a string

@phansys
Copy link
Contributor

Doesn't this should be merged in 2.3? Regardless the technical BC break, it's a bugfix.

…icitly, since it's the only allowed network of a `/0` size
@zerkms
Copy link
ContributorAuthor

@phansys yep, I think it should be, but it's up to the core dev team to decide.

@stof
Copy link
Member

👍 and it should indeed go in 2.3

@fabpot
Copy link
Member

Thank you@zerkms.

fabpot added a commit that referenced this pull requestMay 20, 2015
…works (zerkms)This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#14690).Discussion----------[HttpFoundation] IpUtils::checkIp4() should allow `/0` networks| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | yes| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#14674| License       | MITTechnically it's a breaking change, since the result of the    IpUtils::checkIp4('1.2.3.4', '0.0.0.0/0')call was `false` now `true`.Practically - no one should ever relied on this since it's simply wrongCommits-------921ecff [HttpFoundation] IpUtils::checkIp4() should allow  networks
@fabpotfabpot closed thisMay 20, 2015
@zerkmszerkms deleted the IPUTILS_ZERO_MASK_BUG_14674 branchMay 20, 2015 07:44
@zerkms
Copy link
ContributorAuthor

Guys, I see it's merged to 2.3, but will it eventually be included into 2.7, 2.8 and 3.0?

@dosten
Copy link
Contributor

@zerkms exactly

@zerkms
Copy link
ContributorAuthor

@dosten how does it (porting) usually happen in symfony?

@dosten
Copy link
Contributor

@zerkms merge between maintained versions. Ex: 2.3 -> 2.6 -> 2.7 -> 2.8 -> master

fabpot added a commit that referenced this pull requestJan 25, 2016
…ed proxy (zerkms)This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes#15706).Discussion----------[framework-bundle] Added support for the `0.0.0.0/0` trusted proxy| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| License       | MITIt is relevant to my other PR:#14690The original intention was to start accepting `0.0.0.0/0` as a trusted proxy (which is a valid CIDR notation).The prupose is to allow all requests to be treated as trusted and to eliminate using dirty `['0.0.0.0/1', '128.0.0.0/1']` workaround.Commits-------3188e1b Added support for the `0.0.0.0/0` trusted proxy
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.

5 participants

@zerkms@dosten@phansys@stof@fabpot

[8]ページ先頭

©2009-2025 Movatter.jp