Disable loading of external XML entities when loading XML
Fixes CVE-2011-4107
This commit is contained in:

committed by
Marc Delisle

parent
e3d3ef7af2
commit
5fa86b8e81
@@ -61,6 +61,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
|
||||
*
|
||||
|
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user