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