Skip to content

Commit 74e641c

Browse files
committed
refactor: use htmlentities() and htmlspecialchars_decode()
mb_convert_encoding($str, 'HTML-Entities') is deprecated in PHP 8.2.
1 parent 1fe58f0 commit 74e641c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

system/Test/DOMParser.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ public function getBody(): string
6161
*/
6262
public function withString(string $content)
6363
{
64-
// converts all special characters to utf-8
65-
$content = mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8');
64+
// converts all special characters to HTML-Entities
65+
$content = htmlentities($content);
66+
$content = htmlspecialchars_decode($content);
6667

6768
// turning off some errors
6869
libxml_use_internal_errors(true);

0 commit comments

Comments
 (0)