Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions page.queuemetrics.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@
$settings = queuemetrics_get_details();

foreach ($settings as $key => $val) {
$var[$val['keyword']] = isset($_REQUEST[$val['keyword']]) ? $_REQUEST[$val['keyword']] : $val['value'];
$$val['keyword'] = $var[$val['keyword']];
// Ensure the key exists and is a valid string
$keyword = is_string($val['keyword']) ? $val['keyword'] : 'unknown_key';

// Ensure value is not an array
$value = isset($_REQUEST[$keyword]) ? $_REQUEST[$keyword] : $val['value'];

if (is_array($value)) {
$value = json_encode($value); // Convert array to JSON string
}

$var[$keyword] = $value;
${$keyword} = $value; // Dynamically create a variable
}

$checked = (isset($ivr_logging) && $ivr_logging == 'true')?'CHECKED':'';
Expand Down