From 5f1b34a1946e96e3059f9a8c14e9398321d4e122 Mon Sep 17 00:00:00 2001 From: frytimo Date: Sun, 16 Nov 2025 00:28:52 -0400 Subject: [PATCH] When the $show variable is false or null the condition for `!$show == all` will always evaluate to true. (#7617) The call to action_name with $destination_app_data empty (no action for destination number) will cause a PHP warning. --- app/destinations/destinations.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/app/destinations/destinations.php b/app/destinations/destinations.php index b2dbdd6c21..78047ad224 100644 --- a/app/destinations/destinations.php +++ b/app/destinations/destinations.php @@ -231,26 +231,21 @@ unset($sql, $parameters); //update the array to add the actions - if (!$show == "all") { + if ($show != "all") { $x = 0; foreach ($destinations as $row) { + $destinations[$x]['actions'] = ''; if (!empty($row['destination_actions'])) { //prepare the destination actions if (!empty(json_decode($row['destination_actions'], true))) { + //add the actions to the array + $destination_app_data = []; foreach (json_decode($row['destination_actions'], true) as $action) { $destination_app_data[] = $action['destination_app'].':'.$action['destination_data']; } + $actions = action_name($destination_array, $destination_app_data); + $destinations[$x]['actions'] = (!empty($actions)) ? implode(', ', $actions) : ''; } - - //add the actions to the array - $actions = action_name($destination_array, $destination_app_data); - $destinations[$x]['actions'] = (!empty($actions)) ? implode(', ', $actions) : ''; - - //empty the array before the next iteration - unset($destination_app_data); - } - else { - $destinations[$x]['actions'] = ''; } $x++; }