diff --git a/cp/app/Controllers/ContactsController.php b/cp/app/Controllers/ContactsController.php index c4131e0..0698164 100644 --- a/cp/app/Controllers/ContactsController.php +++ b/cp/app/Controllers/ContactsController.php @@ -209,7 +209,7 @@ class ContactsController extends Controller } } } - + $normalizedVoice = normalizePhoneNumber($voice, strtoupper($postalInfoIntCc)); if (isset($normalizedVoice['error'])) { $this->container->get('flash')->addMessage('error', 'Unable to create contact: ' . $normalizedVoice['error']); @@ -217,6 +217,12 @@ class ContactsController extends Controller } $voice = $normalizedVoice['success']; + // Validate length of $voice + if (strlen($voice) > 17) { + $this->container->get('flash')->addMessage('error', 'Unable to create contact: Phone number exceeds 17 characters'); + return $response->withHeader('Location', '/contact/create')->withStatus(302); + } + if (!empty($fax)) { $normalizedFax = normalizePhoneNumber($fax, strtoupper($postalInfoIntCc)); if (isset($normalizedFax['error'])) { diff --git a/cp/resources/views/admin/domains/createApplication.twig b/cp/resources/views/admin/domains/createApplication.twig index ed75161..74f24b9 100644 --- a/cp/resources/views/admin/domains/createApplication.twig +++ b/cp/resources/views/admin/domains/createApplication.twig @@ -73,7 +73,7 @@