fooRequestElementBar() functions renamed, adding of request parameters added:
[mailer.git] / inc / wrapper-functions.php
index de2d8c0fdb9c613f1c536a6b6047d13474174ccf..c9f97c7b212f8f057c1dc78425d2b18761572cb5 100644 (file)
@@ -257,12 +257,17 @@ 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
        if (!isset($GLOBALS['mxchange_installing'])) {
                // Check URL (css.php/js.php need this)
-               $GLOBALS['mxchange_installing'] = isGetRequestElementSet('installing');
+               $GLOBALS['mxchange_installing'] = isGetRequestParameterSet('installing');
        } // END - if
 
        // Return result
@@ -379,14 +384,25 @@ 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
+
+       // Mark them as flushed
+       $GLOBALS['header'] = array();
 }
 
 // Wrapper function for chmod()
@@ -421,9 +437,9 @@ function removeFile ($FQFN) {
 // Wrapper for $_POST['sel']
 function countPostSelection ($element = 'sel') {
        // Is it set?
-       if (isPostRequestElementSet($element)) {
+       if (isPostRequestParameterSet($element)) {
                // Return counted elements
-               return countSelection(postRequestElement($element));
+               return countSelection(postRequestParameter($element));
        } else {
                // Return zero if not found
                return 0;