diff --git a/core/databases/app_defaults.php b/core/databases/app_defaults.php index 986d78f9e1..7a1e31a866 100644 --- a/core/databases/app_defaults.php +++ b/core/databases/app_defaults.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - 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): @@ -25,7 +25,7 @@ */ //proccess this only one time -if ($domains_processed == 1) { +if (!empty($domains_processed) && $domains_processed == 1) { //set the database driver $sql = "select * from v_databases "; diff --git a/core/databases/database_edit.php b/core/databases/database_edit.php index 8df6a25696..c91c128bc2 100644 --- a/core/databases/database_edit.php +++ b/core/databases/database_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - 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. Contributor(s): @@ -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"; $database_uuid = $_REQUEST["id"]; } @@ -87,7 +87,7 @@ if (count($_POST)>0 && empty($_POST["persistformvar"])) { //delete the database 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 $array[0]['checked'] = 'true'; $array[0]['uuid'] = $database_uuid; diff --git a/core/databases/resources/classes/databases.php b/core/databases/resources/classes/databases.php index e201662968..8b9edee5e2 100644 --- a/core/databases/resources/classes/databases.php +++ b/core/databases/resources/classes/databases.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - 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. Contributor(s): @@ -76,7 +76,7 @@ if (!class_exists('databases')) { //build the delete array 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']; } } @@ -122,7 +122,7 @@ if (!class_exists('databases')) { //get checked records 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']."'"; } } @@ -132,7 +132,7 @@ if (!class_exists('databases')) { $sql = "select * from v_".$this->table." "; $sql .= "where ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") "; $database = new database; - $rows = $database->select($sql, $parameters, 'all'); + $rows = $database->select($sql, $parameters ?? null, 'all'); if (is_array($rows) && @sizeof($rows) != 0) { foreach ($rows as $x => $row) {