Skip to content

Commit

Permalink
fix(isMobilePhone): update es-CO locale (#1541)
Browse files Browse the repository at this point in the history
  • Loading branch information
ezkemboi authored Dec 3, 2020
1 parent 5810e36 commit 302d295
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
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})?[2-9]{1}\d{6}$/,
'es-CO': /^(\+?57)?([1-8]{1}|3[0-9]{2})?[0-9]{1}\d{6}$/,
'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
3 changes: 2 additions & 1 deletion test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -6436,6 +6436,8 @@ describe('Validators', () => {
'5784321235',
'5784321235',
'9821235',
'573011140876',
'0698345',
],
invalid: [
'1234',
Expand All @@ -6447,7 +6449,6 @@ describe('Validators', () => {
'5714003425432',
'5703013347567',
'069834567',
'0698345',
'969834567',
],
},
Expand Down
2 changes: 1 addition & 1 deletion validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3811,7 +3811,7 @@ var 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})?[2-9]{1}\d{6}$/,
'es-CO': /^(\+?57)?([1-8]{1}|3[0-9]{2})?[0-9]{1}\d{6}$/,
'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
2 changes: 1 addition & 1 deletion validator.min.js

Large diffs are not rendered by default.

3 comments on commit 302d295

@jhoalx
Copy link

@jhoalx jhoalx commented on 302d295 Mar 3, 2021

Choose a reason for hiding this comment

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

Hi @ezkemboi , why is it passing local landlines as valid?, isn't the function isMobilePhone() intended to validate Mobile phones Only?

edit:
to be clear: how is 0698345 a valid mobile number? i'm dialing to and it disconnects the call instantly

@tux-tn
Copy link
Member

@tux-tn tux-tn commented on 302d295 Mar 4, 2021

Choose a reason for hiding this comment

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

Hi @ezkemboi , why is it passing local landlines as valid?, isn't the function isMobilePhone() intended to validate Mobile phones Only?

edit:
to be clear: how is 0698345 a valid mobile number? i'm dialing to and it disconnects the call instantly

Hello @jhoalx thank you for your comment. Can you open an issue if you think the regex is not valid?

@jhoalx
Copy link

@jhoalx jhoalx commented on 302d295 Mar 4, 2021

Choose a reason for hiding this comment

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

Hi @ezkemboi , why is it passing local landlines as valid?, isn't the function isMobilePhone() intended to validate Mobile phones Only?
edit:
to be clear: how is 0698345 a valid mobile number? i'm dialing to and it disconnects the call instantly

Hello @jhoalx thank you for your comment. Can you open an issue if you think the regex is not valid?

I'll do it, thanks

Please sign in to comment.