Skip to content

Fix incorrect IPv6 validation logic in String::is_valid_ip_address()#112554

Closed
PrIzRaKDev wants to merge 1 commit into
godotengine:masterfrom
PrIzRaKDev:patch-2
Closed

Fix incorrect IPv6 validation logic in String::is_valid_ip_address()#112554
PrIzRaKDev wants to merge 1 commit into
godotengine:masterfrom
PrIzRaKDev:patch-2

Conversation

@PrIzRaKDev
Copy link
Copy Markdown
Contributor

Rewrites the IP validation logic to correctly handle IPv6 and IPv4. Prevents false positives such as 2001:db8:::1 and improves overall compliance with standard IP formatting rules.

Before:

before.mp4

After:

after.mp4

Closes #112511

Rewrites the IP validation logic to correctly handle IPv6 and IPv4.
Prevents false positives such as 2001:db8:::1 and improves overall compliance with standard IP formatting rules.

Closes godotengine#112511
@PrIzRaKDev PrIzRaKDev requested a review from a team as a code owner November 8, 2025 18:49
@Ivorforce
Copy link
Copy Markdown
Member

Ivorforce commented Nov 8, 2025

Hello, thank you for opening a pull request!

I'm noticing your code doesn't respect our code guidelines, please have a look and review your pull request: https://contributing.godotengine.org/en/latest/engine/guidelines/index.html

It may be especially worthwhile for you to set up a pre-commit hook.

While I haven't reviewed the code yet in detail, I have a gut feeling that it can be simplified. The old code (albeit not always correct, going by the linked issue) seemed to have done a decent job with a lot less logic. I'm guessing it will be possible to keep a similar amount of complexity for the fix.

@PrIzRaKDev
Copy link
Copy Markdown
Contributor Author

Hello, thank you for opening a pull request!

I'm noticing your code doesn't respect our code guidelines, please have a look and review your pull request: https://contributing.godotengine.org/en/latest/engine/guidelines/index.html

While I haven't reviewed the code yet, I have a gut feeling that the code can be simplified. The old code (albeit not always correct) seemed to have done a decent job with a lot less logic. I'm guessing it will be possible to keep a similar amount of complexity for the fix.

Hello. Okay, I will take your comments into account and correct the code.

@akien-mga
Copy link
Copy Markdown
Member

akien-mga commented Jan 13, 2026

Superseded by #114827. Thanks for the contribution!

@akien-mga akien-mga closed this Jan 13, 2026
@akien-mga akien-mga removed this from the 4.6 milestone Jan 13, 2026
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.

IPv6 address validation accepts invalid addresses

5 participants