From bbddc7b671ae76317ca7e7d676d23f9d4df8f783 Mon Sep 17 00:00:00 2001 From: Thomas Schaaf Date: Mon, 15 Nov 2021 23:08:13 +0100 Subject: [PATCH 1/2] revert #1391 --- src/lib/isMobilePhone.js | 2 +- test/validators.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index c70310ef7..bb10c6383 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -26,7 +26,7 @@ const phones = { 'ca-AD': /^(\+376)?[346]\d{5}$/, 'cs-CZ': /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/, 'da-DK': /^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/, - 'de-DE': /^((\+49|0)[1|3])([0|5][0-45-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/, + 'de-DE': /^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/, 'de-AT': /^(\+43|0)\d{1,4}\d{3,12}$/, 'de-CH': /^(\+41|0)([1-9])\d{1,9}$/, 'de-LU': /^(\+352)?((6\d1)\d{6})$/, diff --git a/test/validators.js b/test/validators.js index a4e00293b..a545c925b 100644 --- a/test/validators.js +++ b/test/validators.js @@ -6207,7 +6207,6 @@ describe('Validators', () => { locale: 'de-DE', valid: [ '+4915123456789', - '+4930405044550', '015123456789', '015123456789', '015623456789', @@ -6222,6 +6221,7 @@ describe('Validators', () => { '015412345678', ], invalid: [ + '+4930405044550', '34412345678', '14412345678', '16212345678', From a1077535cf6b6732538f4cedff4659029bc8bd5f Mon Sep 17 00:00:00 2001 From: Thomas Schaaf Date: Mon, 15 Nov 2021 23:12:49 +0100 Subject: [PATCH 2/2] remove invalid number blocks --- test/validators.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/validators.js b/test/validators.js index a545c925b..fa122684a 100644 --- a/test/validators.js +++ b/test/validators.js @@ -6217,8 +6217,6 @@ describe('Validators', () => { '01631234567', '01701234567', '017612345678', - '015345678910', - '015412345678', ], invalid: [ '+4930405044550', @@ -6230,6 +6228,8 @@ describe('Validators', () => { '17012345678', '+4912345678910', '+49015123456789', + '015345678910', + '015412345678', ], }, {