]> git.mxchange.org Git - mailer.git/blobdiff - inc/request-functions.php
Several double->single convertions, fix for missing constant '_MYSQL_PREFIX' which...
[mailer.git] / inc / request-functions.php
index 5f9f1e263bb2b36378af1ddf877dc7d161a2c130..bf045e11feb4ab76c248045395363b71abc972ba 100644 (file)
@@ -113,7 +113,7 @@ function REQUEST_SET_GET ($element, $value) {
 }
 
 // Wrapper for elements in $_POST
-function REQUEST_POST ($element, $subElement=-1) {
+function REQUEST_POST ($element, $subElement=null) {
        // By default no element is there
        $value = null;
 
@@ -126,16 +126,16 @@ function REQUEST_POST ($element, $subElement=-1) {
                $value = $GLOBALS['raw_request']['post'][$element];
 
                // Is $subElement set?
-               if (($subElement != -1) && (REQUEST_ISSET_POST($element, $subElement))) {
+               if ((!is_null($subElement)) && (REQUEST_ISSET_POST($element, $subElement))) {
                        // Then use this
                        $value = SQL_ESCAPE($value[$subElement]);
-               } else {
+               } elseif (!is_array($value)) {
                        // Escape it here
                        $value = SQL_ESCAPE($value);
                }
 
                // Set it in cache
-               $GLOBALS['cache_request']['request_post'][$element][$subElement] = SQL_ESCAPE($value);
+               $GLOBALS['cache_request']['request_post'][$element][$subElement] = $value;
        } // END - if
 
        // Return value