Skip to content

Commit

Permalink
fix(isMobilePhone): fixed pl-PL matching numbers that start with 45 (#…
Browse files Browse the repository at this point in the history
…2202)

Co-authored-by: Mariusz Wroński <mwronski@trans.eu>
  • Loading branch information
czerwony03 and Mariusz Wroński authored Aug 3, 2023
1 parent ad41eba commit 2f551c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const phones = {
'nl-NL': /^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,
'nl-AW': /^(\+)?297(56|59|64|73|74|99)\d{5}$/,
'nn-NO': /^(\+?47)?[49]\d{7}$/,
'pl-PL': /^(\+?48)? ?[5-8]\d ?\d{3} ?\d{2} ?\d{2}$/,
'pl-PL': /^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,
'pt-BR': /^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,
'pt-PT': /^(\+?351)?9[1236]\d{7}$/,
'pt-AO': /^(\+244)\d{9}$/,
Expand Down
2 changes: 2 additions & 0 deletions test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8761,6 +8761,7 @@ describe('Validators', () => {
'+48 56 6572724',
'+48 67 621 5461',
'48 67 621 5461',
'+48 45 621 5461',
],
invalid: [
'+48 67 621 5461',
Expand All @@ -8771,6 +8772,7 @@ describe('Validators', () => {
'1800-88-8687',
'+6019-5830837',
'357562855',
'+48 44 621 5461',
],
},
{
Expand Down

0 comments on commit 2f551c6

Please sign in to comment.