Skip to content
This repository was archived by the owner on May 16, 2018. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix for issue 393 - always reset libxml_disable_entity_loader
by resetting libxml as soon as possible
  • Loading branch information
croensch committed Aug 11, 2014
commit 23999e26d994af239da3b8295f83329da9f12bb7
17 changes: 6 additions & 11 deletions library/Zend/Xml/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@ public static function scan($xml, DOMDocument $dom = null)
$result = $dom->loadXml($xml, LIBXML_NONET);
restore_error_handler();

// Entity load to previous setting
if (!self::isPhpFpm()) {
libxml_disable_entity_loader($loadEntities);
libxml_use_internal_errors($useInternalXmlErrors);
}

if (!$result) {
// Entity load to previous setting
if (!self::isPhpFpm()) {
libxml_disable_entity_loader($loadEntities);
libxml_use_internal_errors($useInternalXmlErrors);
}
return false;
}

Expand All @@ -114,12 +115,6 @@ public static function scan($xml, DOMDocument $dom = null)
}
}

// Entity load to previous setting
if (!self::isPhpFpm()) {
libxml_disable_entity_loader($loadEntities);
libxml_use_internal_errors($useInternalXmlErrors);
}

if (isset($simpleXml)) {
$result = simplexml_import_dom($dom);
if (!$result instanceof SimpleXMLElement) {
Expand Down