Skip to content

Commit d61322c

Browse files
authored
fix(isMobilePhone): fix 'ro-RO' matching invalid numbers (#2156)
fixes #2055
1 parent c332e5c commit d61322c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const phones = {
131131
'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}))$/,
132132
'pt-PT': /^(\+?351)?9[1236]\d{7}$/,
133133
'pt-AO': /^(\+244)\d{9}$/,
134-
'ro-RO': /^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/,
134+
'ro-RO': /^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,
135135
'ru-RU': /^(\+?7|8)?9\d{9}$/,
136136
'si-LK': /^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,
137137
'sl-SI': /^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,

test/validators.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8856,6 +8856,8 @@ describe('Validators', () => {
88568856
'740123456',
88578857
'+40640123456',
88588858
'+40210123456',
8859+
'+0765351689',
8860+
'+0711419752',
88598861
],
88608862
},
88618863
{

0 commit comments

Comments
 (0)