From 331ee16a71d536c59bd5e2e0e840c4a8ee3dc93c Mon Sep 17 00:00:00 2001 From: Xbird Date: Sat, 13 Aug 2022 22:59:48 +0200 Subject: [PATCH] Edit regex to allow space in phone numbers Allowing to set multiple phone in one case, separed by space, but still digits only --- src/Form/Type/PhoneType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Form/Type/PhoneType.php b/src/Form/Type/PhoneType.php index 0f4d84f..853e98c 100644 --- a/src/Form/Type/PhoneType.php +++ b/src/Form/Type/PhoneType.php @@ -13,7 +13,7 @@ class PhoneType extends AbstractType { $resolver->setDefaults([ 'constraints' => [ - new Regex('/^[0-9]*$/', 'form_constraint_digit_only') + new Regex('/^[0-9 ]*$/', 'form_constraint_digit_only') ], 'attr' => ['placeholder' => 'form_placeholder_phone'], 'help' => 'form_help_phone',