X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fwrapper-functions.php;h=5195c0c1e7c716abe6bffe17f24367b875cb2994;hp=64ef91e97eab10b77805853a904dd609bf0d4715;hb=f0e095401c24cf94f760de965c39f7ae35d32d25;hpb=0bf269e4e23914d73991dda245948d651ab2c2d9 diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 64ef91e97e..5195c0c1e7 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 @@ -677,7 +677,9 @@ function getScriptOutputMode () { // Setter for 'output_mode' value function setOutputMode ($newOutputMode) { - $GLOBALS['output_mode'] = (int) $newOutputMode; + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'output_mode=' . $newOutputMode); + $GLOBALS['output_mode'] = (int) $newOutputMode; + $GLOBALS['getScriptOutputMode'] = (int) $newOutputMode; } // Checks wether output_mode is set and optionally aborts on miss @@ -1106,6 +1108,15 @@ function getHttpStatus () { * @access private */ function sendRawRedirect ($url) { + // Clear output buffer + clearOutputBuffer(); + + // Clear own output buffer + $GLOBALS['output'] = ''; + + // To make redirects working (no content type), output mode must be raw + setOutputMode(-1); + // Send helping header setHttpStatus('302 Found'); @@ -1221,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