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 38d8af8..257dfe1 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;