Skip to content
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

Mobile Number Validation Bug: Invalid Numbers Passing Validation #2591

Open
DraKen0009 opened this issue Nov 10, 2024 · 1 comment
Open

Mobile Number Validation Bug: Invalid Numbers Passing Validation #2591

DraKen0009 opened this issue Nov 10, 2024 · 1 comment

Comments

@DraKen0009
Copy link
Contributor

DraKen0009 commented Nov 10, 2024

Describe the bug
The mobile number validation allows invalid phone numbers like +000000000000 and +9876543210123456, which ideally should not be considered valid. This issue is due to a bug in the regular expression used in the validation logic.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the mobile number validation function located here.
  2. Try validating phone numbers like +000000000000 or +9876543210123456.
  3. Observe that these numbers are incorrectly validated as valid.

Expected behavior
Phone numbers with formats like +000000000000 and overly long sequences like +9876543210123456 should not pass validation.

Additional context
This issue seems to be caused by the current regex pattern: regex link.

@DraKen0009
Copy link
Contributor Author

I think we should add some proper validations instead of using regex pattern bcz

  1. Stricter regex fails for some valid numbers
  2. Simpler regex validates the invalid numbers

cc: @sainak

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

No branches or pull requests

1 participant