Skip to content
Snippets Groups Projects
Commit e866743d authored by Jaime Perez's avatar Jaime Perez
Browse files

Revert "Fail gracefully while parsing EntitiesDescriptor in the metarefresh...

Revert "Fail gracefully while parsing EntitiesDescriptor in the metarefresh module. Now only the offending entity is disregarded. Fixes #70."

This reverts commit 6a614913.
parent 7b87e0e0
No related branches found
No related tags found
No related merge requests found
...@@ -216,31 +216,7 @@ class sspmod_metarefresh_MetaLoader { ...@@ -216,31 +216,7 @@ class sspmod_metarefresh_MetaLoader {
throw new Exception('Failed to read XML from ' . $source['src']); throw new Exception('Failed to read XML from ' . $source['src']);
} }
if($doc->documentElement === NULL) throw new Exception('Opened file is not an XML document: ' . $source['src']); if($doc->documentElement === NULL) throw new Exception('Opened file is not an XML document: ' . $source['src']);
$entities = SimpleSAML_Metadata_SAMLParser::parseDescriptorsElement($doc->documentElement);
if (SimpleSAML_Utilities::isDOMElementOfType($doc->documentElement, 'EntitiesDescriptor', '@md') === TRUE) {
foreach (SAML2_Utils::xpQuery($doc->documentElement,
'./saml_metadata:EntityDescriptor|./saml_metadata:EntitiesDescriptor') as $node) {
if ($node->localName === 'EntityDescriptor') {
try {
$entities = array_merge($entities,
SimpleSAML_Metadata_SAMLParser::parseDescriptorsElement($node));
} catch (Exception $e) {
$entityID = $node->getAttribute('entityID');
if (empty($entityID)) {
$entityID = "unknown";
}
SimpleSAML_Logger::warning('[metarefresh]: Error while parsing entity ('.$entityID.'): '.
$e->getMessage());
}
} else {
$entities = array_merge($entities, $this->loadXML($node->ownerDocument->saveXML($node), $source));
}
}
} else {
$entities = SimpleSAML_Metadata_SAMLParser::parseDescriptorsElement($doc->documentElement);
}
return $entities; return $entities;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment