Skip to content
Snippets Groups Projects
Commit 7b4b04ae authored by Olav Morken's avatar Olav Morken
Browse files

SAML2_Utils: Handle NULL values in NameID.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1650 44740490-163a-0410-bde0-09ae8108e29a
parent 3972068c
No related branches found
No related tags found
No related merge requests found
...@@ -176,13 +176,13 @@ class SAML2_Utils { ...@@ -176,13 +176,13 @@ class SAML2_Utils {
$xml = $node->ownerDocument->createElementNS(SAML2_Const::NS_SAML, 'saml:NameID'); $xml = $node->ownerDocument->createElementNS(SAML2_Const::NS_SAML, 'saml:NameID');
$node->appendChild($xml); $node->appendChild($xml);
if (array_key_exists('NameQualifier', $nameId)) { if (array_key_exists('NameQualifier', $nameId) && $nameId['NameQualifier'] !== NULL) {
$xml->setAttribute('NameQualifier', $nameId['NameQualifier']); $xml->setAttribute('NameQualifier', $nameId['NameQualifier']);
} }
if (array_key_exists('SPNameQualifier', $nameId)) { if (array_key_exists('SPNameQualifier', $nameId) && $nameId['SPNameQualifier'] !== NULL) {
$xml->setAttribute('SPNameQualifier', $nameId['SPNameQualifier']); $xml->setAttribute('SPNameQualifier', $nameId['SPNameQualifier']);
} }
if (array_key_exists('Format', $nameId)) { if (array_key_exists('Format', $nameId) && $nameId['Format'] !== NULL) {
$xml->setAttribute('Format', $nameId['Format']); $xml->setAttribute('Format', $nameId['Format']);
} }
......
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