mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
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.
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user