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.
This commit is contained in:
Yahnis Elsts 2022-10-15 20:58:18 +03:00
parent a680a49789
commit b85b82f82d
1 changed files with 4 additions and 1 deletions

View File

@ -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 '</table>';