X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Frequest-functions.php;h=bf045e11feb4ab76c248045395363b71abc972ba;hb=b8aa17b98b99c27eafbdca0fa090bae63527da9a;hp=5f9f1e263bb2b36378af1ddf877dc7d161a2c130;hpb=1355d2c0b29510dbd407f9cde9f41a5ac02d01fa;p=mailer.git diff --git a/inc/request-functions.php b/inc/request-functions.php index 5f9f1e263b..bf045e11fe 100644 --- a/inc/request-functions.php +++ b/inc/request-functions.php @@ -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