From 037edd090d37b037df883da7af0c2cfeb791a694 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 29 Aug 2017 21:38:15 +0200 Subject: [PATCH] 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 --- src/phorkie/HtmlParser.php | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.30.2