From a311552c568d679748ea54b0490a68a9924a50e9 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Fri, 29 May 2020 06:30:53 +0900 Subject: [PATCH] Bug fixes for not initialized array calls --- www/lib/CoreLibs/ACL/Login.php | 2 +- www/lib/CoreLibs/DB/SQL/PgSQL.php | 2 +- www/lib/CoreLibs/Output/Form/Generate.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/www/lib/CoreLibs/ACL/Login.php b/www/lib/CoreLibs/ACL/Login.php index 988ce6ab..dfb9d535 100644 --- a/www/lib/CoreLibs/ACL/Login.php +++ b/www/lib/CoreLibs/ACL/Login.php @@ -597,7 +597,7 @@ class Login extends \CoreLibs\DB\IO // unset mem limit if debug is set to 1 // if (($GLOBALS["DEBUG_ALL"] || $GLOBALS["DB_DEBUG"] || $_SESSION["DEBUG_ALL"] || $_SESSION["DB_DEBUG"]) && ini_get('memory_limit') != -1) // ini_set('memory_limit', -1); - if ($res['filename'] == $this->page_name) { + if (isset($res['filename']) && $res['filename'] == $this->page_name) { $this->permission_okay = true; } else { $this->login_error = 103; diff --git a/www/lib/CoreLibs/DB/SQL/PgSQL.php b/www/lib/CoreLibs/DB/SQL/PgSQL.php index 925bb693..1f7df192 100644 --- a/www/lib/CoreLibs/DB/SQL/PgSQL.php +++ b/www/lib/CoreLibs/DB/SQL/PgSQL.php @@ -311,7 +311,7 @@ class PgSQL $q .= "AND indisprimary"; $cursor = $this->__dbQuery($q); if ($cursor) { - return $this->__dbFetchArray($cursor)['column_name']; + return $this->__dbFetchArray($cursor)['column_name'] ?? false; } else { return false; } diff --git a/www/lib/CoreLibs/Output/Form/Generate.php b/www/lib/CoreLibs/Output/Form/Generate.php index a43cebca..3ebd9d90 100644 --- a/www/lib/CoreLibs/Output/Form/Generate.php +++ b/www/lib/CoreLibs/Output/Form/Generate.php @@ -1646,7 +1646,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO // data part, read from where [POST] // radio group selections (only one can be active) if ($data_array['type'] == 'radio_group') { - if ($i == $_POST[$prfx.$el_name]) { + if (isset($_POST[$prfx.$el_name]) && $i == $_POST[$prfx.$el_name]) { $_value = $i + 1; } else { $_value = 'NULL';