From: Roland Häder Date: Sun, 28 Feb 2010 09:53:18 +0000 (+0000) Subject: Possible fix if wrong user id is entered X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=718b0e4fa583fd61764d9be2657445f50265dcdc;p=mailer.git Possible fix if wrong user id is entered --- diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 6cbb71e3b8..665cb5ed50 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -770,11 +770,20 @@ function getUserData ($column) { // Geter for whole user data array function getUserDataArray () { + // Get user id + $uid = getCurrentUserId(); + // User id should not be zero - if (getCurrentUserId() < 1) debug_report_bug(__FUNCTION__.': User id is zero.'); + if ($uid < 1) debug_report_bug(__FUNCTION__.': User id is zero.'); - // Get the whole array - return $GLOBALS['user_data'][getCurrentUserId()]; + // Get the whole array if found + if (isset($GLOBALS['user_data'][$uid])) { + // Found, so return it + return $GLOBALS['user_data'][$uid]; + } else { + // Return empty array + return array(); + } } // Checks if the user data is valid, this may indicate that the user has logged