From b85b82f82d4b83dd6b519d6c7dd2aa4a6a77b436 Mon Sep 17 00:00:00 2001 From: Yahnis Elsts Date: Sat, 15 Oct 2022 20:58:18 +0300 Subject: [PATCH] Fixed deprecation notice related to htmlentities. The notice: "Passing null to parameter #1 ($string) of type string is deprecated". This could be triggered because some update fields can be null, like the upgrade notice field. --- Puc/v5p0/DebugBar/Panel.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Puc/v5p0/DebugBar/Panel.php b/Puc/v5p0/DebugBar/Panel.php index 99bb725..3a46cf3 100644 --- a/Puc/v5p0/DebugBar/Panel.php +++ b/Puc/v5p0/DebugBar/Panel.php @@ -122,7 +122,10 @@ if ( !class_exists(Panel::class, false) && class_exists('Debug_Bar_Panel', false $fields = $this->getUpdateFields(); foreach($fields as $field) { if ( property_exists($update, $field) ) { - $this->row(ucwords(str_replace('_', ' ', $field)), htmlentities($update->$field)); + $this->row( + ucwords(str_replace('_', ' ', $field)), + isset($update->$field) ? htmlentities($update->$field) : null + ); } } echo '';