Skip to content

Commit

Permalink
Update readme. Fixes slimphp#110
Browse files Browse the repository at this point in the history
  • Loading branch information
odan committed Aug 29, 2024
1 parent b392338 commit ecc0933
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
```

Expand Down

0 comments on commit ecc0933

Please sign in to comment.