diff --git a/README.md b/README.md index 2bf515c..6c90e00 100644 --- a/README.md +++ b/README.md @@ -183,9 +183,9 @@ The following function uses the `htmlspecialchars` function with specific flags to ensure proper encoding: ```php -function html(string $text = null): string +function html(?string $text = null): string { - return htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); + return htmlspecialchars($text ?? '', ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); } ```