]> _ Git - cubist_util.git/commitdiff
wip #6944 @8
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Jun 2024 15:22:24 +0000 (17:22 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Jun 2024 15:22:24 +0000 (17:22 +0200)
src/Html.php

index f231faa3da20e911b0fca58b5e769cd433240091..397e1b66c735dcbc8f755af37a39368a3945bb61 100644 (file)
@@ -52,10 +52,9 @@ class Html
         }
         try {
             $doc = new DOMDocument('1.0', 'utf-8');
-            $doc->loadHTML($string);
+            $doc->loadHTML('<meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . $string);
 
-            $res= static::_getTextNode($doc);
-            return $res;
+            return static::_getTextNode($doc);
         } catch (\Exception $e) {
             return [$string];
         }