Skip to content
Snippets Groups Projects
Commit 54e4791a authored by Jaime Pérez's avatar Jaime Pérez
Browse files

bugfix: Make sure we can deal with attribute values that are not strings (i.e. DOMNodeList).

This is due to the update of the SAML2 library, that caused several other bugs, mainly with attributes like eduPersonTargetedID, which should always be an SAML NameID.
parent 2ad48527
No related branches found
No related tags found
No related merge requests found
......@@ -74,11 +74,21 @@ try {
// store the authentication data in the memcache server
$data = '';
foreach ($authData as $n => $v) {
if (is_array($v)) {
$v = implode(':', $v);
foreach ($authData as $name => $values) {
if (is_array($values)) {
foreach ($values as $i => $value) {
if (!is_a($value, 'DOMNodeList')) {
continue;
}
/* @var \DOMNodeList $value */
if ($value->length === 0) {
continue;
}
$values[$i] = new \SAML2\XML\saml\AttributeValue($value->item(0)->parentNode);
}
$values = implode(':', $values);
}
$data .= $n.'='.$v."\r\n";
$data .= $name.'='.$values."\r\n";
}
$memcache = $amc->getMemcache();
......
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