tsugiproject / tsugi

Tsugi Admin, Developer, and Management Console (pls join the dev list)
http://www.tsugi.org
Apache License 2.0
346 stars 257 forks source link

Deprecated: htmlentities(): Passing null to parameter #146

Closed TurRil closed 2 years ago

TurRil commented 2 years ago

Error shown on page:

Deprecated: htmlentities(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/vhosts/tsugi/vendor/tsugi/lib/src/Util/U.php on line 53

PHP 8.1 deprecates these calls, it does not make them errors. The purpose of deprecation is to give authors advance notice to fix their code, so you and the authors of libraries you use have until PHP 9.0 comes out to fix things.

Fix is:

public static function htmlent_utf8($string) { return htmlentities($string ?? '',ENT_QUOTES,$encoding = 'UTF-8'); }

TurRil commented 2 years ago

PHP Deprecated Warning '...' with message 'htmlspecialchars(): Passing null to parameter ($string) of type string is deprecated'

TurRil commented 2 years ago

Merged and done