Skip to content

[HttpFoundation] [http-foundation] Check if ip is in cidr subnet #20082

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

damienfern
Copy link
Contributor

While I was searching a way to check if an IP is included in a CIDR subnet, I found this old stack overflow : https://stackoverflow.com/questions/594112/check-whether-or-not-a-cidr-subnet-contains-an-ip-address

This old question has of course an old answer but also has a "recent" one that might answer to 99% use cases of Symfony devs. And should be in the documentation.

@carsonbot carsonbot added this to the 5.4 milestone Jul 29, 2024
@damienfern damienfern force-pushed the docs/http-foundation-check-ip-in-cidr branch from 22bf1bf to 24a61bd Compare July 29, 2024 15:37
@carsonbot carsonbot changed the title [http-foundation] Check if ip is in cidr subnet [HttpFoundation] [http-foundation] Check if ip is in cidr subnet Aug 7, 2024
@javiereguiluz javiereguiluz merged commit 6dc347a into symfony:5.4 Aug 7, 2024
3 checks passed
@javiereguiluz
Copy link
Member

Thank you Damien.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants