From 7dcc4b1a79ce72e977ace2165e73bafb8134e3a7 Mon Sep 17 00:00:00 2001 From: Paul Spenke Date: Mon, 23 Nov 2026 11:13:42 +0100 Subject: [PATCH] fix phpb_e helper to accept null values --- plugi-core/src/Core/helpers.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugi-core/src/Core/helpers.php b/plugi-core/src/Core/helpers.php index 8b2ff94..e605c56 100644 --- a/plugi-core/src/Core/helpers.php +++ b/plugi-core/src/Core/helpers.php @@ -7,13 +7,13 @@ if (! function_exists('phpb_e')) { /** * Encode HTML special characters in a string. * - * @param string $value + * @param string|null $value * @param bool $doubleEncode * @return string */ - function phpb_e(string $value, bool $doubleEncode = true): string + function phpb_e(?string $value, bool $doubleEncode = true): string { - return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', $doubleEncode); + return htmlspecialchars($value ?? '', ENT_QUOTES, 'UTF-8', $doubleEncode); } }