Prevent a warning if the bridge variables are disabled

This commit is contained in:
FusionPBX 2023-10-27 20:26:33 -06:00 committed by GitHub
parent 935774d3c0
commit 9b1493d567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 8 deletions

View File

@ -54,7 +54,6 @@
//get http post variables and set them to php variables //get http post variables and set them to php variables
if (!empty($_POST)) { if (!empty($_POST)) {
//view_array($_POST);
$bridge_uuid = $_POST["bridge_uuid"]; $bridge_uuid = $_POST["bridge_uuid"];
$bridge_name = $_POST["bridge_name"]; $bridge_name = $_POST["bridge_name"];
$bridge_action = $_POST["bridge_action"]; $bridge_action = $_POST["bridge_action"];
@ -219,13 +218,17 @@
//initialize the bridge_variables array from session bridge variables //initialize the bridge_variables array from session bridge variables
$session_variables = []; $i = 0; $session_variables = []; $i = 0;
foreach($_SESSION['bridge']['variable'] as $variable) { if (!empty($_SESSION['bridge']['variable'])) {
$variable = explode("=", $variable); foreach($_SESSION['bridge']['variable'] as $variable) {
$session_variables[$i]['name'] = $variable[0]; if (!empty($variable)) {
$session_variables[$i]['value'] = $variable[1] ?? ''; $variable = explode("=", $variable);
$session_variables[$i]['label'] = ucwords(str_replace('_', ' ', $variable[0])); $session_variables[$i]['name'] = $variable[0];
$session_variables[$i]['label'] = str_replace('Effective Caller Id', 'Caller ID', $session_variables[$i]['label']); $session_variables[$i]['value'] = $variable[1] ?? '';
$i++; $session_variables[$i]['label'] = ucwords(str_replace('_', ' ', $variable[0]));
$session_variables[$i]['label'] = str_replace('Effective Caller Id', 'Caller ID', $session_variables[$i]['label']);
$i++;
}
}
} }
//get the bridge variables from the database bridge_destination value //get the bridge variables from the database bridge_destination value