Manually activate libxml external entity resolver
[phorkie.git] / src / phorkie / HtmlParser.php
index b8cd1aff3dbece084445bde9617321aba0ae64bf..257dfe14e6f8a7bda71a5b2d3e384c4a515b8d4d 100644 (file)
@@ -97,6 +97,7 @@ class HtmlParser
         } else {
             $sx = simplexml_import_dom(\DOMDocument::loadHTML($html));
         }
+        //FIXME: handle network error
 
         $elems = $sx->xpath('//*[@rel="vcs-git"]');
         $titles = $sx->xpath('/html/head/title');
@@ -173,6 +174,8 @@ class HtmlParser
     public function getHtmlTitle($url)
     {
         libxml_use_internal_errors(true);
+        //allow loading URLs in DOMDocument
+        libxml_disable_entity_loader(false);
         $doc = \DOMDocument::loadHTMLFile($url);
         if ($doc === false) {
             return null;