summaryrefslogtreecommitdiffstats
path: root/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-04-11 15:21:54 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2015-04-11 15:21:54 +0200
commite63fbaebcba2ef3330ed34426b76bb3ad4156ea6 (patch)
tree9a5e930af3aff537b8afe03863f5252f982c10fb /vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php
parent896577ae02b38412c6045111d9ecb13d7e81b00f (diff)
update picofeed, fix #763
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;
}