diff --git a/app/time_conditions/time_condition_edit.php b/app/time_conditions/time_condition_edit.php index 0b2649273b..069222b537 100644 --- a/app/time_conditions/time_condition_edit.php +++ b/app/time_conditions/time_condition_edit.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) 2008-2020 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -103,6 +103,7 @@ } //check for all required data + $msg = null; //if (empty($domain_uuid)) { $msg .= $text['label-required-domain_uuid']."
\n"; } if (empty($dialplan_name)) { $msg .= $text['label-required-dialplan_name']."
\n"; } if (empty($dialplan_number)) { $msg .= $text['label-required-dialplan_number']."
\n"; } @@ -481,7 +482,7 @@ } //execute query - if (is_array($array) && @sizeof($array) != 0) { + if (!empty($array) && is_array($array) && @sizeof($array) != 0) { //grant temporary permissions $p = new permissions; $p->add('dialplan_detail_add', 'temp'); @@ -626,7 +627,7 @@ if (is_array($preset) && @sizeof($preset) != 0) { foreach ($preset as $preset_name => $preset_variables) { //loop through each condition group - if (is_array($current_conditions)) { + if (!empty($current_conditions) && is_array($current_conditions)) { foreach ($current_conditions as $group_id => $condition_variables) { $matches = 0; if (is_array($condition_variables)) { @@ -657,8 +658,8 @@ } //sort arrays by keys - if (is_array($dialplan_actions)) { ksort($dialplan_actions); } - if (is_array($current_conditions)) { ksort($current_conditions); } + if (!empty($dialplan_actions) && is_array($dialplan_actions)) { ksort($dialplan_actions); } + if (!empty($current_conditions) && is_array($current_conditions)) { ksort($current_conditions); } } @@ -1022,7 +1023,7 @@ function add_custom_condition($destination, $group_id, $dialplan_action = '') { if ($action == 'update') { $largest_group_id = 0; - if (is_array($current_conditions)) { + if (!empty($current_conditions) && is_array($current_conditions)) { foreach ($current_conditions as $group_id => $conditions) { if (empty($current_presets) || (is_array($current_presets) && !in_array($group_id, $current_presets))) { add_custom_condition($destination, $group_id, $dialplan_actions[$group_id]); @@ -1218,7 +1219,7 @@ if ($action == 'update') { echo " \n";