fix phone validation
This commit is contained in:
@ -50,12 +50,12 @@ exports.isValidPhoneNumber = function (phone) {
|
||||
const cleanedPhone = phone.replace(/\s|-/g, '');
|
||||
|
||||
// Check if the phone starts with '08' and has 10 digits
|
||||
if (cleanedPhone.startsWith('08') && cleanedPhone.length === 10) {
|
||||
if ((cleanedPhone.startsWith('08') || cleanedPhone.startsWith('07')) && cleanedPhone.length === 10) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if the phone starts with '+359' and has the correct length
|
||||
if (cleanedPhone.startsWith('+359') && cleanedPhone.length === 12) {
|
||||
if (cleanedPhone.startsWith('+359') && cleanedPhone.length === 13) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user