fix error when no attribute in the assertion

This commit is contained in:
Benjamin Dauvergne 2009-08-13 15:27:29 +02:00
parent e62aeea51c
commit 0d325902f3
1 changed files with 3 additions and 1 deletions

View File

@ -51,6 +51,7 @@ class LassoSPKitHelper {
and copy them into array $attributes. */
static function assertionExtractAttributes($assertion) {
$attributes = array();
if ($assertion->attributeStatement && array_length($assertion->attributeStatement)) {
foreach ($assertion->attributeStatement[0]->attribute as $attribute) {
if ($attribute->name == LASSO_SAML2_ATTRIBUTE_NAME_EPR) {
continue;
@ -60,7 +61,8 @@ class LassoSPKitHelper {
array_push($arr, $value->any[0]->content);
}
$attributes[$attribute->name] = $arr;
}
}
}
return $attributes;
}
/** Return the NameID found in profile->nameIdentifier. If throw is TRUE