Skip to content

Commit 2f551c6

Browse files
czerwony03Mariusz Wroński
and
Mariusz Wroński
authoredAug 3, 2023
fix(isMobilePhone): fixed pl-PL matching numbers that start with 45 (#2202)
Co-authored-by: Mariusz Wroński <mwronski@trans.eu>
1 parent ad41eba commit 2f551c6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 

‎src/lib/isMobilePhone.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const phones = {
131131
'nl-NL': /^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,
132132
'nl-AW': /^(\+)?297(56|59|64|73|74|99)\d{5}$/,
133133
'nn-NO': /^(\+?47)?[49]\d{7}$/,
134-
'pl-PL': /^(\+?48)? ?[5-8]\d ?\d{3} ?\d{2} ?\d{2}$/,
134+
'pl-PL': /^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,
135135
'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}))$/,
136136
'pt-PT': /^(\+?351)?9[1236]\d{7}$/,
137137
'pt-AO': /^(\+244)\d{9}$/,

‎test/validators.test.js

+2
Original file line numberDiff line numberDiff line change
@@ -8761,6 +8761,7 @@ describe('Validators', () => {
87618761
'+48 56 6572724',
87628762
'+48 67 621 5461',
87638763
'48 67 621 5461',
8764+
'+48 45 621 5461',
87648765
],
87658766
invalid: [
87668767
'+48 67 621 5461',
@@ -8771,6 +8772,7 @@ describe('Validators', () => {
87718772
'1800-88-8687',
87728773
'+6019-5830837',
87738774
'357562855',
8775+
'+48 44 621 5461',
87748776
],
87758777
},
87768778
{

0 commit comments

Comments
 (0)
Please sign in to comment.