Disable loading of external XML entities when loading XML

Fixes CVE-2011-4107
This commit is contained in:
Michal Čihař
2011-11-07 14:47:54 +01:00
parent a8a93c3e5a
commit a5e206fbd2
2 changed files with 33 additions and 19 deletions

View File

@@ -63,6 +63,13 @@ while (! ($finished && $i >= $len) && ! $error && ! $timeout_passed) {
unset($data);
/**
* Disable loading of external XML entities.
*/
if (function_exists('libxml_disable_entity_loader')) {
libxml_disable_entity_loader();
}
/**
* Load the XML string
*

View File

@@ -56,6 +56,13 @@ while (! ($finished && $i >= $len) && ! $error && ! $timeout_passed) {
unset($data);
/**
* Disable loading of external XML entities.
*/
if (function_exists('libxml_disable_entity_loader')) {
libxml_disable_entity_loader();
}
/**
* Load the XML string
*