From: Marek Bachmann Date: Wed, 7 Dec 2022 17:50:16 +0000 (+0100) Subject: set character encoding to utf-8 for parsing rendered-html X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d590df9a72eb842813dff45d24d2698698a6f958;p=friendica.git set character encoding to utf-8 for parsing rendered-html --- diff --git a/src/Model/Item.php b/src/Model/Item.php index 767c41acfd..e7bf057b4c 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -3143,9 +3143,9 @@ class Item */ private function cutAttachedImages($rendered_html) { - $doc = new DOMDocument(); + $doc = new DOMDocument('1.0', 'UTF-8'); libxml_use_internal_errors(true); - $doc->loadHTML($rendered_html); + $doc->loadHTML(mb_convert_encoding($rendered_html, 'html-entities', 'utf-8')); libxml_clear_errors(); $root = $doc->getElementsByTagName("p")[0];