From bfa5492e21436c9595a310a2fb862a0637fa1104 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 3 May 2022 09:46:26 -0600 Subject: [PATCH] Allow an empty destination so that values can be nulled. --- app/destinations/resources/classes/destinations.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/destinations/resources/classes/destinations.php b/app/destinations/resources/classes/destinations.php index 7b5099147d..f81447d749 100644 --- a/app/destinations/resources/classes/destinations.php +++ b/app/destinations/resources/classes/destinations.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2017 - 2020 + Portions created by the Initial Developer are Copyright (C) 2017 - 2022 the Initial Developer. All Rights Reserved. Contributor(s): @@ -990,7 +990,15 @@ if (!class_exists('destinations')) { * valid destination */ public function valid($destination, $type = 'dialplan') { + //allow an empty destination + if ($destination == ':') { + return true; + } + + //get all of the $destinations $destinations = $this->all($type); + + //loop through destinations to validate them foreach($destinations as $category => $array) { if (is_array($array)) { foreach ($array as $key => $value) {