Skip to content
Snippets Groups Projects
Commit 226f65e7 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Fix for handling empty set of entityattributes. element without children

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2722 44740490-163a-0410-bde0-09ae8108e29a
parent 61230287
No related merge requests found
...@@ -60,8 +60,10 @@ class SAML2_XML_mdattr_EntityAttributes { ...@@ -60,8 +60,10 @@ class SAML2_XML_mdattr_EntityAttributes {
$e = $doc->createElementNS(SAML2_XML_mdattr_EntityAttributes::NS, 'mdattr:EntityAttributes'); $e = $doc->createElementNS(SAML2_XML_mdattr_EntityAttributes::NS, 'mdattr:EntityAttributes');
$parent->appendChild($e); $parent->appendChild($e);
foreach ($this->children as $child) { if (!empty($this->children)) {
$child->toXML($e); foreach ($this->children as $child) {
$child->toXML($e);
}
} }
return $e; return $e;
......
...@@ -886,7 +886,7 @@ class SimpleSAML_Metadata_SAMLParser { ...@@ -886,7 +886,7 @@ class SimpleSAML_Metadata_SAMLParser {
// and not at RoleDescriptor level // and not at RoleDescriptor level
if ($element instanceof SAML2_XML_md_EntityDescriptor) { if ($element instanceof SAML2_XML_md_EntityDescriptor) {
if ($e instanceof SAML2_XML_mdattr_EntityAttributes) { if ($e instanceof SAML2_XML_mdattr_EntityAttributes && !empty($e->children)) {
foreach($e->children AS $attr) { foreach($e->children AS $attr) {
......
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