php-debugbar icon indicating copy to clipboard operation
php-debugbar copied to clipboard

Always provide htmlentities with a string, for PHP8.1

Open OdyX opened this issue 2 years ago • 1 comments

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

OdyX avatar Apr 28 '22 12:04 OdyX

Maybe better

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

erikn69 avatar Jun 27 '22 21:06 erikn69