diff --git a/app/Purifier.php b/app/Purifier.php index 67e90c90bd0b..b15ed3e44955 100644 --- a/app/Purifier.php +++ b/app/Purifier.php @@ -591,7 +591,7 @@ public static function bool($value) */ public static function encodeHtml($string) { - return $string ? htmlspecialchars($string, ENT_QUOTES, static::$defaultCharset) : ''; + return $string !== null ? htmlspecialchars($string, ENT_QUOTES, static::$defaultCharset) : $string; } /** @@ -603,7 +603,7 @@ public static function encodeHtml($string) */ public static function decodeHtml($string) { - return $string ? html_entity_decode($string, ENT_QUOTES, static::$defaultCharset) : ''; + return $string !== null ? html_entity_decode($string, ENT_QUOTES, static::$defaultCharset) : $string; } }