From e81220d9975c9fb67137d6535ac7c4529e56ae62 Mon Sep 17 00:00:00 2001 From: fusionate Date: Mon, 13 May 2024 11:22:32 -0600 Subject: [PATCH] Time Conditions - Edit: Mitigate PHP 8.x warnings. --- app/destinations/resources/destinations.php | 10 +++++----- app/dialplans/resources/classes/dialplan.php | 6 +++--- app/time_conditions/time_condition_edit.php | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/destinations/resources/destinations.php b/app/destinations/resources/destinations.php index 40e7f4be51..be44fd7735 100644 --- a/app/destinations/resources/destinations.php +++ b/app/destinations/resources/destinations.php @@ -26,8 +26,8 @@ $destinations = $destination->get($destination_type); //show the select - echo " \n"; + echo " \n"; foreach($destinations as $key => $rows) { $singular = $destination->singular($key); if ($key == $action && permission_exists("{$singular}_destinations")) { @@ -50,12 +50,12 @@ $select_label = str_replace('email-icon', '✉', $select_label); //add the select option - $uuid = isset($row[$singular.'_uuid']) ? $row[$singular.'_uuid'] : $row['uuid']; - echo " \n"; + $uuid = isset($row[$singular.'_uuid']) ? $row[$singular.'_uuid'] : ($row['uuid'] ?? ''); + echo " \n"; } } } } echo " \n"; -?> +?> \ No newline at end of file diff --git a/app/dialplans/resources/classes/dialplan.php b/app/dialplans/resources/classes/dialplan.php index f583da8898..dbc73b6c71 100644 --- a/app/dialplans/resources/classes/dialplan.php +++ b/app/dialplans/resources/classes/dialplan.php @@ -826,8 +826,8 @@ $xml .= "\n"; } - //add to the dialplanss - $dialplans[$previous_dialplan_uuid] = $xml; + //add to the dialplans + $dialplans[$previous_dialplan_uuid] = $xml ?? ''; $xml = ''; $dialplan_tag_status = "closed"; @@ -1039,7 +1039,7 @@ //set the xml array and then concatenate the array to a string //$xml .= " \n"; - ///$xml .= " \n"; + //$xml .= " \n"; //$xml .= "\n"; } //end if source = details diff --git a/app/time_conditions/time_condition_edit.php b/app/time_conditions/time_condition_edit.php index 69410eb801..2d60b49bbb 100644 --- a/app/time_conditions/time_condition_edit.php +++ b/app/time_conditions/time_condition_edit.php @@ -73,7 +73,7 @@ $dialplan_number = $_POST["dialplan_number"]; $dialplan_order = $_POST["dialplan_order"]; - $dialplan_anti_action = $_POST["dialplan_anti_action"]; + $dialplan_anti_action = $_POST["dialplan_anti_action"] ?? ''; $dialplan_anti_action_array = explode(":", $dialplan_anti_action); $dialplan_anti_action_app = array_shift($dialplan_anti_action_array); $dialplan_anti_action_data = join(':', $dialplan_anti_action_array); @@ -272,7 +272,7 @@ if (is_array($_REQUEST['variable'])) { foreach ($_REQUEST['variable'] as $group_id => $meh) { if ( - (!empty($_REQUEST['preset']) && is_array($_REQUEST['preset']) && in_array($group_id, $_REQUEST['preset']) && $_REQUEST['dialplan_action'][$group_id] == '' && $_REQUEST['default_preset_action'] == '' && $_REQUEST['dialplan_anti_action'] == '') || + (!empty($_REQUEST['preset']) && is_array($_REQUEST['preset']) && in_array($group_id, $_REQUEST['preset']) && empty($_REQUEST['dialplan_action'][$group_id]) && empty($_REQUEST['default_preset_action']) && empty($_REQUEST['dialplan_anti_action'])) || ((empty($_REQUEST['preset']) || !is_array($_REQUEST['preset']) || !in_array($group_id, $_REQUEST['preset'])) && $_REQUEST['dialplan_action'][$group_id] == '') ) { unset($_REQUEST['variable'][$group_id]);