Skip to content

Commit

Permalink
fix(isMobilePhone): prevent allowing landline numbers in es-CO (#1623)
Browse files Browse the repository at this point in the history
* fix(isMobilePhone): prevent validator from allowing landline numbers in es-CO locale

* fix(isMobilePhone): prevent es-CO validator from allowing invalid number
  • Loading branch information
tux-tn committed Mar 12, 2021
1 parent 6262f62 commit 418df05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Expand Up @@ -56,7 +56,7 @@ const phones = {
'en-ZW': /^(\+263)[0-9]{9}$/,
'es-AR': /^\+?549(11|[2368]\d)\d{8}$/,
'es-BO': /^(\+?591)?(6|7)\d{7}$/,
'es-CO': /^(\+?57)?([1-8]{1}|3[0-9]{2})?[0-9]{1}\d{6}$/,
'es-CO': /^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,
'es-CL': /^(\+?56|0)[2-9]\d{1}\d{7}$/,
'es-CR': /^(\+506)?[2-8]\d{7}$/,
'es-DO': /^(\+?1)?8[024]9\d{7}$/,
Expand Down
16 changes: 8 additions & 8 deletions test/validators.js
Expand Up @@ -6506,18 +6506,11 @@ describe('Validators', () => {
valid: [
'+573003321235',
'573003321235',
'579871235',
'3003321235',
'3213321235',
'3103321235',
'3253321235',
'3321235',
'574321235',
'5784321235',
'5784321235',
'9821235',
'3243321235',
'573011140876',
'0698345',
],
invalid: [
'1234',
Expand All @@ -6530,6 +6523,13 @@ describe('Validators', () => {
'5703013347567',
'069834567',
'969834567',
'579871235',
'574321235',
'5784321235',
'5784321235',
'9821235',
'0698345',
'3321235',
],
},
{
Expand Down

0 comments on commit 418df05

Please sign in to comment.