Fixed: htmlspecialchars(): Passing null to parameter (#719)

This commit is contained in:
Roman Kelesidis 2023-05-24 22:57:22 +07:00 committed by GitHub
commit 64976d1049
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -358,12 +358,12 @@ function prn_r($var, $title = '', $print = true)
* @param $txt
* @param bool $double_encode
* @param int $quote_style
* @param string $charset
* @param ?string $charset
* @return string
*/
function htmlCHR($txt, $double_encode = false, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
function htmlCHR($txt, bool $double_encode = false, int $quote_style = ENT_QUOTES, ?string $charset = 'UTF-8'): string
{
return (string)htmlspecialchars($txt, $quote_style, $charset, $double_encode);
return (string)htmlspecialchars($txt ?? '', $quote_style, $charset, $double_encode);
}
/**