fix(isMobilePhone): add missing Uzbekistan carrier codes 33, 55, and 77#2725
Open
xxiaoxiong wants to merge 7 commits into
Open
fix(isMobilePhone): add missing Uzbekistan carrier codes 33, 55, and 77#2725xxiaoxiong wants to merge 7 commits into
xxiaoxiong wants to merge 7 commits into
Conversation
The isJWT function currently only validates that the JWT has three dot-separated segments and that each segment is valid URL-safe base64. However, it does not verify that the decoded header and payload are valid JSON. This allows strings like `foo.bar.dGVzdA` to pass validation even though they are not valid JWTs. This fix decodes the base64-encoded header and payload and checks that they parse as valid JSON before returning true. Fixes validatorjs#2511
The `isMobilePhone` function for `uz-UZ` locale was missing newer carrier codes 33 (Humans), 55, and 77 (Ucell). A valid number like `+998770178734` was incorrectly rejected. This adds the missing prefixes to the regex pattern and includes corresponding test cases. Closes validatorjs#2683
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2725 +/- ##
===========================================
- Coverage 100.00% 99.80% -0.20%
===========================================
Files 114 114
Lines 2587 2605 +18
Branches 656 660 +4
===========================================
+ Hits 2587 2600 +13
- Misses 0 4 +4
- Partials 0 1 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(isMobilePhone): add missing Uzbekistan carrier codes 33, 55, and 77
The
isMobilePhonefunction foruz-UZlocale was missing newercarrier codes 33 (Humans), 55, and 77 (Ucell). A valid number like
+998770178734was incorrectly rejected.This adds the missing prefixes to the regex pattern and includes
corresponding test cases.
Closes #2683