Databases: Updates for PHP 8.1

This commit is contained in:
fusionate 2023-06-06 21:19:23 +00:00
parent 22a01b147d
commit 3fddd36858
No known key found for this signature in database
3 changed files with 9 additions and 9 deletions

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@ -25,7 +25,7 @@
*/ */
//proccess this only one time //proccess this only one time
if ($domains_processed == 1) { if (!empty($domains_processed) && $domains_processed == 1) {
//set the database driver //set the database driver
$sql = "select * from v_databases "; $sql = "select * from v_databases ";

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2020 Portions created by the Initial Developer are Copyright (C) 2008-2023
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@ -46,7 +46,7 @@
$text = $language->get(); $text = $language->get();
//action add or update //action add or update
if (is_uuid($_REQUEST["id"])) { if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
$action = "update"; $action = "update";
$database_uuid = $_REQUEST["id"]; $database_uuid = $_REQUEST["id"];
} }
@ -87,7 +87,7 @@ if (count($_POST)>0 && empty($_POST["persistformvar"])) {
//delete the database //delete the database
if (permission_exists('database_delete')) { if (permission_exists('database_delete')) {
if ($_POST['action'] == 'delete' && is_uuid($database_uuid)) { if (!empty($_POST['action']) && $_POST['action'] == 'delete' && is_uuid($database_uuid)) {
//prepare //prepare
$array[0]['checked'] = 'true'; $array[0]['checked'] = 'true';
$array[0]['uuid'] = $database_uuid; $array[0]['uuid'] = $database_uuid;

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2020 Portions created by the Initial Developer are Copyright (C) 2020-2023
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@ -76,7 +76,7 @@ if (!class_exists('databases')) {
//build the delete array //build the delete array
foreach ($records as $x => $record) { foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid']; $array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
} }
} }
@ -122,7 +122,7 @@ if (!class_exists('databases')) {
//get checked records //get checked records
foreach ($records as $x => $record) { foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'"; $uuids[] = "'".$record['uuid']."'";
} }
} }
@ -132,7 +132,7 @@ if (!class_exists('databases')) {
$sql = "select * from v_".$this->table." "; $sql = "select * from v_".$this->table." ";
$sql .= "where ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") "; $sql .= "where ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$database = new database; $database = new database;
$rows = $database->select($sql, $parameters, 'all'); $rows = $database->select($sql, $parameters ?? null, 'all');
if (is_array($rows) && @sizeof($rows) != 0) { if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $x => $row) { foreach ($rows as $x => $row) {