Manually activate libxml external entity resolver
authorChristian Weiske <cweiske@cweiske.de>
Tue, 29 Aug 2017 19:38:15 +0000 (21:38 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 29 Aug 2017 19:38:15 +0000 (21:38 +0200)
so that we are able to load remote URLs with DOMDocument

Resolves: https://github.com/cweiske/phorkie/issues/26

src/phorkie/HtmlParser.php

index 38d8af858206627cc15b78e2c680b2ef3a72b225..257dfe14e6f8a7bda71a5b2d3e384c4a515b8d4d 100644 (file)
@@ -174,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;