]> BookStack Code Mirror - bookstack/blobdiff - app/References/CrossLinkParser.php
Fixed old deprecated encoding convert on HTML doc load
[bookstack] / app / References / CrossLinkParser.php
index 37db203df8f18fd7a9f2d498c8fe4546fa45daf3..e7afea5f1ffd1d16e03576afd1c5ee61b76a9da0 100644 (file)
@@ -54,10 +54,10 @@ class CrossLinkParser
     {
         $links = [];
 
-        $html = '<body>' . $html . '</body>';
+        $html = '<?xml encoding="utf-8" ?><body>' . $html . '</body>';
         libxml_use_internal_errors(true);
         $doc = new DOMDocument();
-        $doc->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));
+        $doc->loadHTML($html);
 
         $xPath = new DOMXPath($doc);
         $anchors = $xPath->query('//a[@href]');