Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Improved support for php8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rskrzypczak committed Oct 31, 2023
1 parent 2fc8aeb commit 971a27c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Purifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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;
}
}

Expand Down

0 comments on commit 971a27c

Please sign in to comment.