Skip to content
Snippets Groups Projects
Commit f3e2e491 authored by Guy Halse's avatar Guy Halse
Browse files

Use array_shift rather than array_values

parent f4675749
No related branches found
No related tags found
No related merge requests found
......@@ -986,9 +986,9 @@ class SAML2
if ($nameIdFormat === null || !isset($state['saml:NameID'][$nameIdFormat])) {
// either not set in request, or not set to a format we supply. Fall back to old generation method
$nameIdFormat = array_values($spMetadata->getArrayizeString('NameIDFormat', null))[0];
$nameIdFormat = array_shift($spMetadata->getArrayizeString('NameIDFormat', null));
if ($nameIdFormat === null) {
$nameIdFormat = array_values($idpMetadata->getArrayizeString('NameIDFormat', \SAML2\Constants::NAMEID_TRANSIENT))[0];
$nameIdFormat = array_shift($idpMetadata->getArrayizeString('NameIDFormat', \SAML2\Constants::NAMEID_TRANSIENT));
}
}
......
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