Skip to content

Conversation

@ShreySinha02
Copy link
Contributor

@ShreySinha02 ShreySinha02 commented Sep 14, 2024

Fixed the incorrect IPv6 address formats:

BC:e4d5:c:e7b9::%40i0nccymtl9cwfKo.5vaeXLSGRMe:EDh2qs5wkhnPws5xQKqafjfAMm6wGFCJ.bVFsZfb
1dC:0DF8:62D:3AC::%KTatXocjaFVioS0RTNQl4mA.V151o0RSy.JIu-D-D8.d3171ZWsSJ7PK4YjkJCRN0F
These addresses are now correctly identified as invalid.

Updated the IPv6 address validation regex to correctly handle and reject invalid IPv6 address formats. The previous regex allowed formats that were not compliant with IPv6 standards. This fix ensures that only valid IPv6 addresses are accepted.

The validation structure is based on the corrected regex from branch #2083, which had merge conflicts that were resolved for accurate validation. This reference ensures that the updated regex conforms to the expected IPv6 address format and resolves the issue with invalid formats.

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)
  • References provided in PR (where applicable)

@WikiRik
Copy link
Member

WikiRik commented Mar 26, 2025

Due to the merger of #2089 this PR also has merge conflicts. Can you resolve them?

Copy link
Member

@WikiRik WikiRik left a comment

Choose a reason for hiding this comment

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

Thanks for rebasing! The isIP tests are now moved to https://github.com/validatorjs/validator.js/blob/master/test/validators/isIP.test.js
Can you add the new test cases there? And remove the empty line you've added to the main test file?

@WikiRik WikiRik requested a review from rubiin March 28, 2025 06:51
@WikiRik WikiRik merged commit 90c19e8 into validatorjs:master Mar 28, 2025
2 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants