From fe3896099d48fd201aece05bd1a87d09551927bd Mon Sep 17 00:00:00 2001 From: Jonathan Daggerhart Date: Fri, 29 May 2015 11:37:25 -0400 Subject: [PATCH] un-lazying approach to getting the first user from a query result --- openid-connect-generic.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openid-connect-generic.php b/openid-connect-generic.php index 3d564c0..bb1425d 100644 --- a/openid-connect-generic.php +++ b/openid-connect-generic.php @@ -277,7 +277,8 @@ class OpenID_Connect_Generic { // if we found an existing users, grab the first one returned if ( $user_query->get_total() > 0 ) { - $user = $user_query->get_results()[0]; + $users = $user_query->get_results(); + $user = $users[0]; } // otherwise, user does not exist and we'll need to create it else {