Skip to content

Commit

Permalink
string '0' should not be treated as empty
Browse files Browse the repository at this point in the history
  • Loading branch information
vendeeglobe committed Nov 11, 2023
1 parent 3c6db44 commit aa1f504
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/class/ut.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,9 @@ static function purge_directory($directory, $ttl = 0, $mask = '*'): int
return $n;
}

/*
* For the purposes of this function, the encodings ISO-8859-1, ISO-8859-15, UTF-8, cp866, cp1251, cp1252, and KOI8-R are effectively equivalent,
* provided the string itself is valid for the encoding, as the characters affected by htmlspecialchars() occupy the same positions in all of these encodings.
*/
static function html($string, $double_encode = true, $charset = HTML_ENTITIES_CHARSET): string
{
if (!$string)
if (empty($string) && $string !== '0')
{
return '';
}
Expand Down

0 comments on commit aa1f504

Please sign in to comment.