]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
Fixes for ext-online (not perfect, but working)
[mailer.git] / inc / wrapper-functions.php
index f9ebb56b1177e7f68491d5bb84d5a1ef21e392d3..76b94ebf864263378e32bb36d72456e5e77d369d 100644 (file)
@@ -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)) {
@@ -677,7 +678,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 +1109,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');
 
@@ -2572,6 +2584,12 @@ function isAjaxOutputMode () {
        return (getScriptOutputMode() == -2);
 }
 
+// Wrapper to check if output mode is image
+function isImageOutputMode () {
+       // Determine it
+       return (getScriptOutputMode() == -3);
+}
+
 // Wrapper to generate a user email link
 function generateWrappedUserEmailLink ($email) {
        // Just call the inner function