summaryrefslogtreecommitdiffstats
path: root/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php')
-rw-r--r--vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php11
1 files changed, 8 insertions, 3 deletions
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;
}