From 7a6f02474e200edab1e2fdcb3ed482bed1f42d82 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 16 Jun 2022 15:07:21 -0600 Subject: [PATCH] Prevent spaces from being considered as a valid destination_number. --- app/destinations/destination_edit.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index f3d7f0e5ce..1e44014a10 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -156,10 +156,15 @@ exit; } + //prevent spaces from being considered as a valid destination_number + if (isset($destination_number)) { + $destination_number = trim($destination_number); + } + //check for all required data $msg = ''; if (strlen($destination_type) == 0) { $msg .= $text['message-required']." ".$text['label-destination_type']."
\n"; } - //if (strlen($destination_number) == 0) { $msg .= $text['message-required']." ".$text['label-destination_number']."
\n"; } + if (strlen($destination_number) == 0) { $msg .= $text['message-required']." ".$text['label-destination_number']."
\n"; } if (strlen($destination_context) == 0) { $msg .= $text['message-required']." ".$text['label-destination_context']."
\n"; } if (strlen($destination_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-destination_enabled']."
\n"; }