diff --git a/mod/imscp/locallib.php b/mod/imscp/locallib.php index 9a02dc14f1d..3ebd1060af0 100644 --- a/mod/imscp/locallib.php +++ b/mod/imscp/locallib.php @@ -104,9 +104,11 @@ function imscp_parse_structure($imscp, $context) { */ function imscp_parse_manifestfile($manifestfilecontents, $imscp, $context) { $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/'; @@ -204,10 +206,14 @@ function imscp_recursive_href($manifestfilename, $imscp, $context) { if (!$manifestfile = $fs->get_file($context->id, 'mod_imscp', 'content', $imscp->revision, $dirname, $filename)) { return null; } + $doc = new DOMDocument(); + $oldentities = libxml_disable_entity_loader(true); if (!$doc->loadXML($manifestfile->get_content(), LIBXML_NONET)) { return null; } + libxml_disable_entity_loader($oldentities); + $xmlresources = $doc->getElementsByTagName('resource'); foreach ($xmlresources as $res) { if (!$href = $res->attributes->getNamedItem('href')) {