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); }