]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
New functions introduced, several rewrites:
[mailer.git] / inc / wrapper-functions.php
index de2d8c0fdb9c613f1c536a6b6047d13474174ccf..1e36678f6f863f53110d5a1863b03301c988b8fa 100644 (file)
@@ -257,6 +257,11 @@ function detectRequestUri () {
        return (getenv('REQUEST_URI'));
 }
 
+// "Getter" for query string
+function detectQueryString () {
+       return str_replace('&', '&', (getenv('QUERY_STRING')));
+}
+
 // Check wether we are installing
 function isInstalling () {
        // Determine wether we are installing
@@ -379,14 +384,22 @@ function copyFileVerified ($source, $dest, $chmod = '') {
 // Wrapper function for header()
 // Send a header but checks before if we can do so
 function sendHeader ($header) {
+       // Send the header
+       $GLOBALS['header'][] = trim($header);
+}
+
+// Flushes all headers
+function flushHeaders () {
        // Is the header already sent?
        if (headers_sent()) {
                // Then abort here
                debug_report_bug('Headers already sent!');
        } // END - if
 
-       // Send the header
-       header(trim($header));
+       // Flush all headers
+       foreach ($GLOBALS['header'] as $header) {
+               header($header);
+       } // END - foreach
 }
 
 // Wrapper function for chmod()
@@ -742,6 +755,7 @@ function isUserDataValid () {
 
 // Setter for current userid
 function setCurrentUserId ($userid) {
+       logDebugMessage(__FUNCTION__, __LINE__, 'userid='.$userid);
        $GLOBALS['current_userid'] = bigintval($userid);
 }