Small CP interface fixes

This commit is contained in:
Pinga 2024-11-25 11:30:31 +02:00
parent b9b9998925
commit b8975ce9ec
5 changed files with 11 additions and 5 deletions

View file

@ -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'])) {