Allow an empty destination so that values can be nulled.

This commit is contained in:
FusionPBX
2022-05-03 09:46:26 -06:00
committed by GitHub
parent 94bc7d9f99
commit bfa5492e21

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
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) {