From 6f440d8172c3dd7ef3ac406747fb2a2264e7f620 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 5 Nov 2009 16:51:30 +0000 Subject: [PATCH 1/1] Possible fix #3 for reflink --- inc/wrapper-functions.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index e9bd29b25e..bc7e771463 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -739,7 +739,7 @@ function getUserDataArray () { // in, but you should use isMember() if you want to find that out. function isUserDataValid () { // User id should not be zero so abort here - if (getCurrentUserId() < 1) return false; + if (!isCurrentUserIdSet()) return false; // Is the array there and filled? return ((isset($GLOBALS['user_data'][getCurrentUserId()])) && (count($GLOBALS['user_data'][getCurrentUserId()]) > 1)); @@ -753,7 +753,7 @@ function setCurrentUserId ($userid) { // Getter for current userid function getCurrentUserId () { // Userid must be set before it can be used - if (!isset($GLOBALS['current_userid'])) { + if (!isCurrentUserIdSet()) { // Not set debug_report_bug('User id is not set.'); } // END - if @@ -762,5 +762,10 @@ function getCurrentUserId () { return $GLOBALS['current_userid']; } +// Checks if current userid is set +function isCurrentUserIdSet () { + return isset($GLOBALS['current_userid']); +} + // [EOF] ?> -- 2.39.2