Skip to content

Commit

Permalink
Stop assuming an ePTID is an array.
Browse files Browse the repository at this point in the history
That might now be the case when the assertion was parsed from the original SAML assertion, but definitely not when we are building the assertion manually.
  • Loading branch information
jaimeperez committed Nov 9, 2016
1 parent 4853f1e commit d01b753
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/SAML2/Assertion.php
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,14 @@ private function addAttributeStatement(\DOMElement $root)
foreach ($values as $eptiValue) {
$attributeValue = $document->createElementNS(Constants::NS_SAML, 'saml:AttributeValue');
$attribute->appendChild($attributeValue);
Utils::addNameId($attributeValue, $eptiValue);
if (is_array($eptiValue)) {
Utils::addNameId($attributeValue, $eptiValue);
} elseif ($eptiValue instanceof \DOMNodeList) {
$node = $root->ownerDocument->importNode($eptiValue->item(0), true);
$attributeValue->appendChild($node);
} else {
$attributeValue->textContent = $eptiValue;
}
}

continue;
Expand Down

0 comments on commit d01b753

Please sign in to comment.