From 8fa01ac88b1208b28b47f57d997db6223f60cb9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 10 Jun 2012 12:53:23 +0000 Subject: [PATCH] Fixes for ext-online (not perfect, but working) --- inc/filter/online_filter.php | 6 +++--- inc/wrapper-functions.php | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/inc/filter/online_filter.php b/inc/filter/online_filter.php index e24b674fd3..bd77265654 100644 --- a/inc/filter/online_filter.php +++ b/inc/filter/online_filter.php @@ -59,7 +59,7 @@ function FILTER_UPDATE_ONLINE_LIST ($filterData) { $userid = NULL; $isMember = convertBooleanToYesNo(isMember()); $isAdmin = convertBooleanToYesNo(isAdmin()); - $action = getActionFromModuleWhat(getModule(), getWhat()); + $action = getActionFromModuleWhat(getModule(), getWhat(false)); // Valid userid? if (isMember()) { @@ -92,7 +92,7 @@ LIMIT 1", array( getModule(), $action, - getWhat(), + getWhat(false), convertZeroToNull($userid), convertZeroToNull(determineReferralId()), $isMember, @@ -106,7 +106,7 @@ LIMIT 1", array( getModule(), $action, - getWhat(), + getWhat(false), convertZeroToNull($userid), convertZeroToNull(determineReferralId()), $isMember, diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index c86787ebc2..76b94ebf86 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -540,12 +540,12 @@ function isNicknameUsed ($userid) { } // Getter for 'what' value -function getWhat () { +function getWhat ($strict = true) { // Default is null $what = NULL; // Is the value set? - if (isWhatSet(true)) { + if (isWhatSet($strict)) { // Then use it $what = $GLOBALS['__what']; } // END - if @@ -571,11 +571,12 @@ function setWhatFromConfig ($configEntry) { // Checks wether what is set and optionally aborts on miss function isWhatSet ($strict = false) { // Check for it - $isset = (isset($GLOBALS['__what']) && (!empty($GLOBALS['__what']))); + $isset = ((isset($GLOBALS['__what']) && (!empty($GLOBALS['__what']))) || (is_null($GLOBALS['__what']))); // Should we abort here? if (($strict === true) && ($isset === false)) { // Output backtrace + die(debug_get_printable_backtrace()); debug_report_bug(__FUNCTION__, __LINE__, 'what is empty.'); } // END - if @@ -606,7 +607,7 @@ function setAction ($newAction) { // Checks wether action is set and optionally aborts on miss function isActionSet ($strict = false) { // Check for it - $isset = ((isset($GLOBALS['__action'])) && (!empty($GLOBALS['__action']))); + $isset = (((isset($GLOBALS['__action'])) && (!empty($GLOBALS['__action']))) || (is_null($GLOBALS['__action']))); // Should we abort here? if (($strict === true) && ($isset === false)) { -- 2.30.2