From c9f7e785a2caabc82d7866560bba352bf0e9aca2 Mon Sep 17 00:00:00 2001 From: pincombe Date: Wed, 24 Jan 2024 10:23:55 +0000 Subject: [PATCH] Fixed null value deprecation (#613) Co-authored-by: Alex Bouma --- src/Former/Helpers.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Former/Helpers.php b/src/Former/Helpers.php index 7e7fa1d4..5407714f 100644 --- a/src/Former/Helpers.php +++ b/src/Former/Helpers.php @@ -29,12 +29,16 @@ public static function setApp(Container $app) /** * Encodes HTML * - * @param string $value The string to encode + * @param string|null $value The string to encode * * @return string */ public static function encode($value) { + if ($value === null) { + return ''; + } + return htmlentities($value, ENT_QUOTES, 'UTF-8', true); }