MDL-45417 mod_imscp: Prevent entity injections from package content

This commit is contained in:
Frederic Massart
2014-07-07 13:03:11 +01:00
committed by Dan Poltawski
parent 3b68d1b23a
commit 9b60a086cf
+2
View File
@@ -105,9 +105,11 @@ function imscp_parse_structure($imscp, $context) {
*/
function imscp_parse_manifestfile($manifestfilecontents) {
$doc = new DOMDocument();
$oldentities = libxml_disable_entity_loader(true);
if (!$doc->loadXML($manifestfilecontents, LIBXML_NONET)) {
return null;
}
libxml_disable_entity_loader($oldentities);
// we put this fake URL as base in order to detect path changes caused by xml:base attributes
$doc->documentURI = 'http://grrr/';