]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Tools/PageContent.php
Fixed OIDC Logout
[bookstack] / app / Entities / Tools / PageContent.php
index 2613359c3afa67cf4f484d842abd1ffe2f9ea1a9..949816eff577cc2fc67e0a36c8507bc4d2efe8d1 100644 (file)
@@ -304,7 +304,9 @@ class PageContent
         if ($blankIncludes) {
             $content = $this->blankPageIncludes($content);
         } else {
-            $content = $this->parsePageIncludes($content);
+            for ($includeDepth = 0; $includeDepth < 3; $includeDepth++) {
+                $content = $this->parsePageIncludes($content);
+            }
         }
 
         return $content;
@@ -449,8 +451,8 @@ class PageContent
     {
         libxml_use_internal_errors(true);
         $doc = new DOMDocument();
-        $html = '<body>' . $html . '</body>';
-        $doc->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));
+        $html = '<?xml encoding="utf-8" ?><body>' . $html . '</body>';
+        $doc->loadHTML($html);
 
         return $doc;
     }