]> git.mxchange.org Git - friendica.git/commitdiff
set character encoding to utf-8 for parsing rendered-html
authorMarek Bachmann <marek.bachmann@comtec.eecs.uni-kassel.de>
Wed, 7 Dec 2022 17:50:16 +0000 (18:50 +0100)
committerMarek Bachmann <marek.bachmann@comtec.eecs.uni-kassel.de>
Wed, 7 Dec 2022 17:50:16 +0000 (18:50 +0100)
src/Model/Item.php

index 767c41acfdcf1adcad0853fc3885b36d712f311a..e7bf057b4c46e884f978328c09b66ceec5b84d89 100644 (file)
@@ -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];