Explorar o código

test DOMDocument

visuddhinanda %!s(int64=3) %!d(string=hai) anos
pai
achega
61e7aa33b3
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      app/Http/Api/MdRender.php

+ 8 - 1
app/Http/Api/MdRender.php

@@ -178,7 +178,14 @@ class MdRender{
             return "<span>xml解析错误{$e}</span>";
         }
 
-
+        /*
+        $doc = new \DOMDocument();
+        $xml = str_replace('MdTpl','dfn',$xml);
+        $ok = $doc->loadHTML($xml,LIBXML_HTML_NODEFDTD | LIBXML_DTDVALID);
+        if(!$ok){
+            return "<span>xml解析错误</span>";
+        }
+        */
 
         $tpl_list = $dom->xpath('//MdTpl');
         foreach ($tpl_list as $key => $tpl) {