fix phpb_e helper to accept null values

This commit is contained in:
2026-11-23 11:13:42 +01:00
parent f072349ed2
commit 7dcc4b1a79
+3 -3
View File
@@ -7,13 +7,13 @@ if (! function_exists('phpb_e')) {
/** /**
* Encode HTML special characters in a string. * Encode HTML special characters in a string.
* *
* @param string $value * @param string|null $value
* @param bool $doubleEncode * @param bool $doubleEncode
* @return string * @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);
} }
} }