From b05b756148e1a1f24deaadcb0a021e77839bba43 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 14 Jan 2024 17:23:57 +0000 Subject: Handling HTML entities via mbstring is deprecated --- include/html2bbcode.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/html2bbcode.php') diff --git a/include/html2bbcode.php b/include/html2bbcode.php index c928b91b1..aca3ff4f8 100644 --- a/include/html2bbcode.php +++ b/include/html2bbcode.php @@ -104,7 +104,11 @@ function html2bbcode($message) $message = preg_replace('=<(\w+):(.+?)>=', '', $message); $message = preg_replace('==', '', $message); - $message = mb_convert_encoding($message, 'HTML-ENTITIES', "UTF-8"); + // mb_convert_encoding() is deprecated + //$message = mb_convert_encoding($message, 'HTML-ENTITIES', "UTF-8"); + $message = mb_encode_numericentity($message, [0x80, 0x10FFFF, 0, ~0], 'UTF-8'); + + if(!$message) return; -- cgit v1.2.3