From a1409ba644c1cc5a2e742affece92bf0da91f986 Mon Sep 17 00:00:00 2001 From: John Okely Date: Thu, 7 Jan 2016 07:22:38 +0000 Subject: [PATCH] MDL-52608 core: Use property_exists in fullname Credit to Dmitriy Kuzevanov for the patch. --- lib/moodlelib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index a6b9018d290..838d225d9ba 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -3268,7 +3268,7 @@ function fullname($user, $override=false) { $allnames = get_all_user_name_fields(); if ($CFG->debugdeveloper) { foreach ($allnames as $allname) { - if (!array_key_exists($allname, $user)) { + if (!property_exists($user, $allname)) { // If all the user name fields are not set in the user object, then notify the programmer that it needs to be fixed. debugging('You need to update your sql to include additional name fields in the user object.', DEBUG_DEVELOPER); // Message has been sent, no point in sending the message multiple times.