From: Christian Weiske Date: Tue, 29 Aug 2017 19:38:15 +0000 (+0200) Subject: Manually activate libxml external entity resolver X-Git-Tag: v0.8.1~2 X-Git-Url: https://git.cweiske.de/phorkie.git/commitdiff_plain/037edd090d37b037df883da7af0c2cfeb791a694 Manually activate libxml external entity resolver so that we are able to load remote URLs with DOMDocument Resolves: https://github.com/cweiske/phorkie/issues/26 --- diff --git a/src/phorkie/HtmlParser.php b/src/phorkie/HtmlParser.php index 38d8af8..257dfe1 100644 --- a/src/phorkie/HtmlParser.php +++ b/src/phorkie/HtmlParser.php @@ -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;