From b15d17b847faa668d0b5a8a64d5bda71f749cc8c Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 25 Jan 2023 15:17:05 +0100 Subject: [PATCH] php8 style issues - fix PHP Deprecated: ... Passing null to parameter errors and some undefined array keys --- src/etc/inc/legacy_bindings.inc | 2 ++ src/www/system_groupmanager.php | 4 ++-- src/www/system_usermanager_passwordmg.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/etc/inc/legacy_bindings.inc b/src/etc/inc/legacy_bindings.inc index 7f93e27b6..5311ca64b 100644 --- a/src/etc/inc/legacy_bindings.inc +++ b/src/etc/inc/legacy_bindings.inc @@ -75,6 +75,8 @@ function legacy_html_escape_form_data(&$settings) foreach ($settings as $dataKey => &$dataValue) { if (is_array($dataValue)) { legacy_html_escape_form_data($dataValue); + } elseif ($dataValue === null) { + $settings[$dataKey] = ''; } else { $settings[$dataKey] = htmlspecialchars($dataValue, ENT_QUOTES | ENT_HTML401); } diff --git a/src/www/system_groupmanager.php b/src/www/system_groupmanager.php index 611746628..ba3f3825a 100644 --- a/src/www/system_groupmanager.php +++ b/src/www/system_groupmanager.php @@ -34,7 +34,7 @@ require_once("guiconfig.inc"); $a_group = &config_read_array('system', 'group'); if ($_SERVER['REQUEST_METHOD'] === 'GET') { - if (isset($a_group[$_GET['groupid']])) { + if (isset($_GET['groupid']) && isset($a_group[$_GET['groupid']])) { $id = $_GET['groupid']; } if (isset($_GET['act']) && ($_GET['act'] == 'edit' || $_GET['act'] == 'new')) { @@ -436,7 +436,7 @@ $( document ).ready(function() { class="btn btn-default btn-xs" data-toggle="tooltip" title=""> - +