fix bugs in php 8.1 changes (#6744)

* Update voicemail_greetings.php

* Update recordings.php

* Update recording_edit.php

* Update phrases.php

* Update phrase_edit.php

* Update music_on_hold_edit.php

* Update fax_queue.php

* Update extensions.php

* Update email_templates.php

* Update email_queue_edit.php

* Update dialplan_inbound_add.php

* Update device_profiles.php

* Update device_profile_copy.php

* Update contact_address_edit.php

* Update call_recordings.php

* Update call_center_agent_edit.php

* Update call_center_agents.php

* Update call_center_queues.php

* Update call_block.php

* Update menu_edit.php

* Update default_setting_edit.php

* Update database_edit.php
This commit is contained in:
Alex
2023-06-05 12:41:28 -06:00
committed by GitHub
parent 791be82f27
commit fb8d0e2983
22 changed files with 43 additions and 47 deletions

View File

@@ -135,7 +135,7 @@
//prepare to page the results
$rows_per_page = (!empty($_SESSION['domain']['paging']['numeric'])) ? $_SESSION['domain']['paging']['numeric'] : 50;
$param = "&search=".$search;
if (!empty($_GET['show']) == "all" && permission_exists('call_block_all')) {
if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('call_block_all')) {
$param .= "&show=all";
}
$page = $_GET['page'] ?? '';

View File

@@ -52,7 +52,7 @@
$agent_password = '';
//check for duplicates
if (!empty($_GET["check"]) == 'duplicate') {
if (!empty($_GET["check"]) && $_GET["check"] == 'duplicate') {
//agent id
if (!empty($_GET["agent_id"])) {
$sql = "select agent_name ";
@@ -610,4 +610,4 @@
//include the footer
require_once "resources/footer.php";
?>
?>

View File

@@ -88,7 +88,7 @@
//get total call center agent count from the database
$sql = "select count(*) from v_call_center_agents ";
$sql .= "where true ";
if (!empty($_GET['show']) != "all" || !permission_exists('call_center_all')) {
if (!empty($_GET['show']) && $_GET['show'] != "all" || !permission_exists('call_center_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
@@ -145,7 +145,7 @@
}
echo "<form id='form_search' class='inline' method='get'>";
if (permission_exists('call_center_all')) {
if (!empty($_GET['show']) == 'all') {
if (!empty($_GET['show']) && $_GET['show'] == 'all') {
echo " <input type='hidden' name='show' value='all'>";
}
else {
@@ -181,7 +181,7 @@
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".(!empty($result) ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
if (!empty($_GET['show']) == "all" && permission_exists('call_center_all')) {
if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('call_center_all')) {
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param, "class='shrink'");
}
//echo th_order_by('domain_uuid', 'domain_uuid', $order_by, $order);
@@ -213,7 +213,7 @@
echo " <input type='hidden' name='call_center_agents[$x][uuid]' value='".escape($row['call_center_agent_uuid'])."' />\n";
echo " </td>\n";
}
if (!empty($_GET['show']) == "all" && permission_exists('call_center_all')) {
if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('call_center_all')) {
if (!empty($_SESSION['domains'][$row['domain_uuid']]['domain_name'])) {
$domain = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
}

View File

@@ -97,7 +97,7 @@
//get total call center queues count from the database
$sql = "select count(*) from v_call_center_queues ";
$sql .= "where true ";
if (!empty($_GET['show']) != "all" || !permission_exists('call_center_all')) {
if (!empty($_GET['show']) && $_GET['show'] != "all" || !permission_exists('call_center_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}

View File

@@ -262,7 +262,7 @@
echo " <input type='hidden' name='call_recordings[$x][uuid]' value='".escape($row['call_recording_uuid'])."' />\n";
echo " </td>\n";
}
if (!empty($_GET['show']) == "all" && permission_exists('call_recording_all')) {
if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('call_recording_all')) {
echo " <td class='overflow hide-sm-dn shrink'>".escape($row['domain_name'])."</td>\n";
}
echo " <td class='hide-sm-dn shrink'>".escape($row['caller_id_name'])."</td>\n";

View File

@@ -202,7 +202,7 @@
}
//pre-populate the form
if (!empty($_GET) && !empty($_POST["persistformvar"])) {
if (!empty($_GET) && empty($_POST["persistformvar"])) {
$contact_address_uuid = $_GET["id"];
$sql = "select * from v_contact_addresses ";
$sql .= "where domain_uuid = :domain_uuid ";
@@ -472,4 +472,4 @@
//include the footer
require_once "resources/footer.php";
?>
?>

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
Portions created by the Initial Developer are Copyright (C) 2008-2023
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -46,7 +46,7 @@
$text = $language->get();
//set the http get/post variable(s) to a php variable
if (is_uuid($_REQUEST["id"])) {
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
$device_profile_uuid = $_REQUEST["id"];
}

View File

@@ -114,7 +114,7 @@
//get the count
$sql = "select count(*) from v_device_profiles ";
$sql .= "where true ";
if (empty($_GET['show']) || $_GET['show'] != "all" || !permission_exists('device_profile_all')) {
if (!empty($_GET['show']) || $_GET['show'] != "all" || !permission_exists('device_profile_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$parameters['domain_uuid'] = $domain_uuid;
}
@@ -296,4 +296,4 @@
//include the footer
require_once "resources/footer.php";
?>
?>

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2016
Portions created by the Initial Developer are Copyright (C) 2008-2023
the Initial Developer. All Rights Reserved.
Contributor(s):

View File

@@ -46,7 +46,7 @@
$text = $language->get();
//action add or update
if (is_uuid($_REQUEST["id"])) {
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
$action = "update";
$email_queue_uuid = $_REQUEST["id"];
$id = $_REQUEST["id"];
@@ -415,4 +415,4 @@
//include the footer
require_once "resources/footer.php";
?>
?>

View File

@@ -112,7 +112,7 @@
//prepare to page the results
$sql = "select count(*) from v_email_templates where true ";
if (!empty($_GET['show']) == "all" && permission_exists('email_template_all')) {
if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('email_template_all')) {
if (!empty($sql_search)) {
$sql .= "and ".$sql_search;
}
@@ -190,7 +190,7 @@
}
echo "<form id='form_search' class='inline' method='get'>\n";
if (permission_exists('email_template_all')) {
if (!empty($_GET['show']) == 'all') {
if (!empty($_GET['show']) && $_GET['show'] == 'all') {
echo " <input type='hidden' name='show' value='all'>";
}
else {
@@ -241,7 +241,7 @@
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".(!empty($result) ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
if (!empty($_GET['show']) == "all" && permission_exists('email_template_all')) {
if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('email_template_all')) {
echo "<th>".$text['label-domain']."</th>\n";
//echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, null, null, $param);
}
@@ -270,7 +270,7 @@
echo " <input type='hidden' name='email_templates[$x][uuid]' value='".escape($row['email_template_uuid'])."' />\n";
echo " </td>\n";
}
if (!empty($_GET['show']) == "all" && permission_exists('email_template_all')) {
if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('email_template_all')) {
echo " <td>";
if (is_uuid($row['domain_uuid'])) {
echo escape($_SESSION['domains'][$row['domain_uuid']]['domain_name']);

View File

@@ -115,8 +115,6 @@
$parameters['search'] = '%'.$search.'%';
}
//get total extension count
$sql = "select count(*) from v_extensions where true ";
if (!(!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('extension_all'))) {

View File

@@ -99,8 +99,6 @@
$order_by = $_GET["order_by"] ?? null;
$order = $_GET["order"] ?? null;
//get the count
$sql = "select count(fax_queue_uuid) ";
$sql .= "from v_fax_queue as q ";
@@ -368,4 +366,4 @@
//include the footer
require_once "resources/footer.php";
?>
?>

View File

@@ -46,7 +46,7 @@
$text = $language->get();
//action add or update
if (is_uuid($_REQUEST["id"])) {
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
$action = "update";
$music_on_hold_uuid = $_REQUEST["id"];
}
@@ -113,7 +113,7 @@
}
//add or update the database
if ($_POST["persistformvar"] != "true") {
if (empty($_POST["persistformvar"])) {
if ($action == "add" && permission_exists('music_on_hold_add')) {
//begin insert array
$array['music_on_hold'][0]['music_on_hold_uuid'] = uuid();
@@ -174,7 +174,7 @@
}
//pre-populate the form
if (count($_GET) > 0 && is_uuid($_GET["id"]) && $_POST["persistformvar"] != "true") {
if (count($_GET) > 0 && is_uuid($_GET["id"]) && empty($_POST["persistformvar"])) {
$music_on_hold_uuid = $_GET["id"];
$sql = "select * from v_music_on_hold ";
$sql .= "where ( ";

View File

@@ -63,7 +63,7 @@
if (count($_POST) > 0) {
//process the http post data by submitted action
if (!empty($_POST['action']) != '' && is_uuid($_POST['phrase_uuid'])) {
if (!empty($_POST['action']) && is_uuid($_POST['phrase_uuid'])) {
$array[0]['checked'] = 'true';
$array[0]['uuid'] = $_POST['phrase_uuid'];
@@ -270,7 +270,7 @@
}
//pre-populate the form
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
if (count($_GET)>0 && empty($_POST["persistformvar"])) {
$phrase_uuid = $_GET["id"];
$sql = "select * from v_phrases ";
$sql .= "where ( ";

View File

@@ -57,7 +57,7 @@
}
//process the http post data by action
if (!empty($action) != '' && is_array($phrases)) {
if (!empty($action) && is_array($phrases)) {
switch ($action) {
case 'copy':
if (permission_exists('phrase_add')) {

View File

@@ -47,7 +47,7 @@
$text = $language->get();
//get recording id
if (is_uuid($_REQUEST["id"])) {
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
$recording_uuid = $_REQUEST["id"];
}
@@ -117,7 +117,7 @@ if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
}
//update the database
if ($_POST["persistformvar"] != "true") {
if (empty($_POST["persistformvar"])) {
if (permission_exists('recording_edit')) {
//if file name is not the same then rename the file
if ($recording_filename != $recording_filename_original) {

View File

@@ -268,7 +268,7 @@
}
//process the http post data by action
if ($action ?? '' && is_array($recordings)) {
if (!empty($action) && is_array($recordings)) {
switch ($action) {
case 'delete':
if (permission_exists('recording_delete')) {

View File

@@ -83,7 +83,7 @@
$greeting_dir = $_SESSION['switch']['storage']['dir'].'/voicemail/default/'.$_SESSION['domains'][$domain_uuid]['domain_name'].'/'.$voicemail_id;
//download the greeting
if (!empty($_GET['a']) == "download" && (permission_exists('voicemail_greeting_play') || permission_exists('voicemail_greeting_download'))) {
if (!empty($_GET['a']) && $_GET['a'] == "download" && (permission_exists('voicemail_greeting_play') || permission_exists('voicemail_greeting_download'))) {
if ($_GET['type'] == "rec") {
//get the id
$voicemail_greeting_uuid = $_GET['uuid'];
@@ -148,7 +148,7 @@
}
//upload the greeting
if (!empty($_POST['a']) == "upload" && permission_exists('voicemail_greeting_upload')
if (!empty($_POST['a']) && $_POST['a'] == "upload" && permission_exists('voicemail_greeting_upload')
&& $_POST['type'] == 'rec' && is_uploaded_file($_FILES['file']['tmp_name'])) {
//validate the token
@@ -256,7 +256,7 @@
}
//set the greeting
if (!empty($_REQUEST['action']) == "set") {
if (!empty($_REQUEST['action']) && $_REQUEST['action'] == "set") {
//save the greeting_id to a variable
$greeting_id = $_REQUEST['greeting_id'];
@@ -304,7 +304,7 @@
}
//get the greetings list
if (!empty($_SESSION['voicemail']['storage_type']['text']) == 'base64') {
if (!empty($_SESSION['voicemail']['storage_type']['text']) && $_SESSION['voicemail']['storage_type']['text'] == 'base64') {
switch ($db_type) {
case 'pgsql': $sql_file_size = ", length(decode(greeting_base64,'base64')) as greeting_size "; break;
case 'mysql': $sql_file_size = ", length(from_base64(greeting_base64)) as greeting_size "; break;
@@ -393,7 +393,7 @@
$col_count++;
echo th_order_by('greeting_name', $text['label-name'], $order_by, $order, null, null, "id=".urlencode($voicemail_id));
$col_count++;
if (!empty($_SESSION['voicemail']['storage_type']['text']) != 'base64') {
if (!empty($_SESSION['voicemail']['storage_type']['text']) && $_SESSION['voicemail']['storage_type']['text'] != 'base64') {
echo th_order_by('greeting_filename', $text['label-filename'], $order_by, $order, null, "class='hide-sm-dn'", "id=".urlencode($voicemail_id));
$col_count++;
}
@@ -403,12 +403,12 @@
}
echo "<th class='center no-wrap hide-xs'>".$text['label-size']."</th>\n";
$col_count++;
if (!empty($_SESSION['voicemail']['storage_type']['text']) != 'base64') {
if (!empty($_SESSION['voicemail']['storage_type']['text']) && $_SESSION['voicemail']['storage_type']['text'] != 'base64') {
echo "<th class='center no-wrap hide-xs'>".$text['label-uploaded']."</th>\n";
$col_count++;
}
echo th_order_by('greeting_description', $text['label-description'], $order_by, $order, null, "class='hide-sm-dn pct-25'", "id=".urlencode($voicemail_id));
if (permission_exists('voicemail_greeting_edit') && !empty($_SESSION['theme']['list_row_edit_button']['boolean']) == 'true') {
if (permission_exists('voicemail_greeting_edit') && !empty($_SESSION['theme']['list_row_edit_button']['boolean']) && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";

View File

@@ -132,7 +132,7 @@ if (count($_POST)>0 && empty($_POST["persistformvar"])) {
}
//add or update the database
if ($_POST["persistformvar"] != "true") {
if (empty($_POST["persistformvar"])) {
//begin array
$array['databases'][0]['database_driver'] = $database_driver;

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2022
Portions created by the Initial Developer are Copyright (C) 2008-2023
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -136,7 +136,7 @@
}
//add or update the database
if ($_POST["persistformvar"] != "true") {
if (empty($_POST["persistformvar"])) {
// fix null
$default_setting_order = ($default_setting_order != '') ? $default_setting_order : 'null';

View File

@@ -92,7 +92,7 @@
}
//add or update the database
if ($_POST["persistformvar"] != "true") {
if (empty($_POST["persistformvar"])) {
if ($action == "add") {
//create a new unique id
$menu_uuid = uuid();