diff --git a/controller/validation/validators.js b/controller/validation/validators.js index 94c8a0c1..0d01a43c 100644 --- a/controller/validation/validators.js +++ b/controller/validation/validators.js @@ -109,7 +109,7 @@ module.exports = Validators = { }, ukmobilephone(value) { - return value === '' || Validators.regex(value, /^(07)\d{9}$/); + return value === '' || Validators.regex(value, /^(?:\+447|07)\d{9}$/); }, date(value) { diff --git a/test/controller/spec/validators.spec.js b/test/controller/spec/validators.spec.js index b187b15c..14405ac0 100644 --- a/test/controller/spec/validators.spec.js +++ b/test/controller/spec/validators.spec.js @@ -396,7 +396,6 @@ describe('Validators', () => { describe('ukmobilephone', () => { describe('invalid values', () => { const inputs = [ - '+447812123456', '+4407812123456', '+44(0)7812123456', '447812123456', @@ -420,7 +419,8 @@ describe('Validators', () => { describe('valid values', () => { const inputs = [ '', - '07812123456' + '07812123456', + '+447812123456' ]; inputs.forEach(i => { it(testName(i), () => {