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 @@
- +
{{ __('Nameservers') }} 
diff --git a/cp/resources/views/admin/domains/createDomain.twig b/cp/resources/views/admin/domains/createDomain.twig index 6235f31..d7c6b51 100644 --- a/cp/resources/views/admin/domains/createDomain.twig +++ b/cp/resources/views/admin/domains/createDomain.twig @@ -68,7 +68,7 @@
- +
{{ __('Nameservers') }} 
diff --git a/cp/resources/views/admin/domains/updateApplication.twig b/cp/resources/views/admin/domains/updateApplication.twig index 562de31..f2224f1 100644 --- a/cp/resources/views/admin/domains/updateApplication.twig +++ b/cp/resources/views/admin/domains/updateApplication.twig @@ -86,7 +86,7 @@
- +
{{ __('Nameservers') }}  
{% for host in domainHosts %}
diff --git a/cp/resources/views/admin/domains/updateDomain.twig b/cp/resources/views/admin/domains/updateDomain.twig index 723793b..9e27c6d 100644 --- a/cp/resources/views/admin/domains/updateDomain.twig +++ b/cp/resources/views/admin/domains/updateDomain.twig @@ -118,7 +118,7 @@
- +
{{ __('Nameservers') }}  
{% for host in domainHosts %}