From e63fbaebcba2ef3330ed34426b76bb3ad4156ea6 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sat, 11 Apr 2015 15:21:54 +0200 Subject: update picofeed, fix #763 --- vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php') diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php index feda8c254..d0c2f8ef0 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php @@ -55,7 +55,9 @@ class XmlParser */ private static function scanInput($input, Closure $callback) { - if (substr(php_sapi_name(), 0, 3) === 'fpm') { + $isRunningFpm = substr(php_sapi_name(), 0, 3) === 'fpm'; + + if ($isRunningFpm) { // If running with PHP-FPM and an entity is detected we refuse to parse the feed // @see https://bugs.php.net/bug.php?id=64938 @@ -64,8 +66,7 @@ class XmlParser } } else { - - libxml_disable_entity_loader(true); + $entityLoaderDisabled = libxml_disable_entity_loader(true); } libxml_use_internal_errors(true); @@ -81,6 +82,10 @@ class XmlParser } } + if ($isRunningFpm === false) { + libxml_disable_entity_loader($entityLoaderDisabled); + } + return $dom; } -- cgit v1.2.3