Skip to content

Commit ecc0933

Browse files
committed
Update readme. Fixes slimphp#110
1 parent b392338 commit ecc0933

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ The following function uses the `htmlspecialchars` function
183183
with specific flags to ensure proper encoding:
184184

185185
```php
186-
function html(string $text = null): string
186+
function html(?string $text = null): string
187187
{
188-
return htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
188+
return htmlspecialchars($text ?? '', ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
189189
}
190190
```
191191

0 commit comments

Comments
 (0)