From f567371fff4ce2087ce061e660820d9196733c92 Mon Sep 17 00:00:00 2001
From: Thijs Kinkhorst <thijs@kinkhorst.com>
Date: Tue, 13 Nov 2018 13:23:44 +0000
Subject: [PATCH] Prevent notice when using array_shift with function output

---
 modules/saml/lib/IdP/SAML2.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/saml/lib/IdP/SAML2.php b/modules/saml/lib/IdP/SAML2.php
index aa498c76e..cfbb5476d 100644
--- a/modules/saml/lib/IdP/SAML2.php
+++ b/modules/saml/lib/IdP/SAML2.php
@@ -1004,9 +1004,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_shift($spMetadata->getArrayizeString('NameIDFormat', null));
+            $nameIdFormat = current($spMetadata->getArrayizeString('NameIDFormat', null));
             if ($nameIdFormat === null) {
-                $nameIdFormat = array_shift($idpMetadata->getArrayizeString('NameIDFormat', \SAML2\Constants::NAMEID_TRANSIENT));
+                $nameIdFormat = current($idpMetadata->getArrayizeString('NameIDFormat', \SAML2\Constants::NAMEID_TRANSIENT));
             }
         }
 
-- 
GitLab