From f595801a31d396e1c64c4fe3871323cc379f5cf3 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Fri, 17 Apr 2015 00:21:29 +0000 Subject: [PATCH] Prevent 'XMPP Gateways' option group from displaying in switch_select_destination() function if none found. --- resources/switch.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/switch.php b/resources/switch.php index 82222f0258..59159c4347 100644 --- a/resources/switch.php +++ b/resources/switch.php @@ -878,7 +878,7 @@ function switch_select_destination($select_type, $select_label, $select_name, $s $result_count = count($result); unset ($prep_statement, $sql); $tmp_selected = ''; - if ($select_type == "bridge" || $select_type == "dialplan" || $select_type == "ivr" || $select_type == "call_center_contact") { + if (sizeof($result) > 0 && ($select_type == "bridge" || $select_type == "dialplan" || $select_type == "ivr" || $select_type == "call_center_contact")) { $options[] = ""; } foreach($result as $row) { @@ -888,7 +888,7 @@ function switch_select_destination($select_type, $select_label, $select_name, $s } if ($selected) { $selection_found = true; } } - if ($select_type == "dialplan" || $select_type == "ivr" || $select_type == "call_center_contact") { + if (sizeof($result) > 0 && ($select_type == "bridge" || $select_type == "dialplan" || $select_type == "ivr" || $select_type == "call_center_contact")) { $options[] = ""; } unset($sql, $result);