-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
fix(isMobilePhone): restrict mk-MK locale to valid mobile numbers only #2579
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
base: master
Are you sure you want to change the base?
Changes from 9 commits
21a4832
edd5342
8528a27
b16eda2
c9e7a73
9f47e19
6e39cd6
12e9a10
a3b5eff
aaf8d70
b1bc18a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -161,7 +161,7 @@ const phones = { | |||||
| 'ar-YE': /^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/, | ||||||
| 'ar-EH': /^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/, | ||||||
| 'fa-AF': /^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/, | ||||||
| 'mk-MK': /^(\+?389|0)?((?:2[2-9]\d{6}|(?:3[1-4]|4[2-8])\d{6}|500\d{5}|5[2-9]\d{6}|7[0-9][2-9]\d{5}|8[1-9]\d{6}|800\d{5}|8009\d{4}))$/, | ||||||
| 'mk-MK': /^(\+3897[0-9]|07[0-9])[0-9]{6}$/, | ||||||
|
||||||
| 'mk-MK': /^(\+3897[0-9]|07[0-9])[0-9]{6}$/, | |
| 'mk-MK': /^(\+3897[0-9]\d{6}|07[0-9]\d{6})$/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern is too restrictive. It only matches numbers starting with +3897 or 07, but according to the test cases, +38971234567 should be valid. The pattern should be /^(+38970[0-9]|070[0-9])[0-9]{6}$/ or adjusted to match the actual mobile number format.