Fix for latest PHP 5.4.x changes
[mailer.git] / inc / wrapper-functions.php
index 76b94ebf864263378e32bb36d72456e5e77d369d..5195c0c1e7c716abe6bffe17f24367b875cb2994 100644 (file)
@@ -571,12 +571,11 @@ 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']))) || (is_null($GLOBALS['__what'])));
+       $isset = (isset($GLOBALS['__what']) && (!empty($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
 
@@ -607,7 +606,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']))) || (is_null($GLOBALS['__action'])));
+       $isset = ((isset($GLOBALS['__action'])) && (!empty($GLOBALS['__action'])));
 
        // Should we abort here?
        if (($strict === true) && ($isset === false)) {
@@ -1233,6 +1232,12 @@ function getTotalRandomRefidUser () {
 
 // Is given userid valid?
 function isValidUserId ($userid) {
+       // Handle NULL
+       if (is_null($userid)) {
+               // Do not handle this as of below isset() will always return false
+               return false;
+       } // END - if
+
        // Do we have cache?
        if (!isset($GLOBALS[__FUNCTION__][$userid])) {
                // Check it out