Skip to content

Always provide htmlentities with a string, for PHP8.1#503

Merged
barryvdh merged 1 commit intophp-debugbar:masterfrom
liip-forks:htmlentities-no-null
Oct 31, 2022
Merged

Always provide htmlentities with a string, for PHP8.1#503
barryvdh merged 1 commit intophp-debugbar:masterfrom
liip-forks:htmlentities-no-null

Conversation

@OdyX
Copy link
Copy Markdown
Contributor

@OdyX OdyX commented Apr 28, 2022

In PHP8.1, htmlentities doesn't accept null as valid first argument; cast any equivalent-to-false into string before passing it to htmlentities.

@erikn69
Copy link
Copy Markdown
Contributor

erikn69 commented Jun 27, 2022

Maybe better

-$params[$name] = htmlentities($param, ENT_QUOTES, 'UTF-8', false);
+$params[$name] = htmlentities((string) $param, ENT_QUOTES, 'UTF-8', false);

@barryvdh barryvdh merged commit 2be80e7 into php-debugbar:master Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants