From cb919714d4904892bcf331017989f1510a94dfb7 Mon Sep 17 00:00:00 2001 From: Kevin Laframboise Date: Mon, 6 Mar 2023 23:46:08 -0500 Subject: [PATCH] fix(isMobilePhone): fixed es-CU matching all numbers that start with 5 longer than 8 digits (#2197) Co-authored-by: Kevin Laframboise fixes #2196 --- src/lib/isMobilePhone.js | 2 +- test/validators.test.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index c6ded55b6..a901a94d8 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -76,7 +76,7 @@ const phones = { 'es-CO': /^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/, 'es-CL': /^(\+?56|0)[2-9]\d{1}\d{7}$/, 'es-CR': /^(\+506)?[2-8]\d{7}$/, - 'es-CU': /^(\+53|0053)?5\d{7}/, + 'es-CU': /^(\+53|0053)?5\d{7}$/, 'es-DO': /^(\+?1)?8[024]9\d{7}$/, 'es-HN': /^(\+?504)?[9|8|3|2]\d{7}$/, 'es-EC': /^(\+?593|0)([2-7]|9[2-9])\d{7}$/, diff --git a/test/validators.test.js b/test/validators.test.js index 239f172ca..6816a3bbb 100644 --- a/test/validators.test.js +++ b/test/validators.test.js @@ -8296,6 +8296,7 @@ describe('Validators', () => { '', 'abc', '+535123457', + '56043029304', ], }, {