X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Frequest-functions.php;h=d7817ba0c921108d059409c33ac75941c3a28cd2;hb=3e4fd7d36d85a58509b19060ae892f37299be92e;hp=a3bd5e3966db704757664c07209c7fc97e8c4708;hpb=0a37fc5afcd828646d4e62e68fea07c3d2c54a87;p=mailer.git
diff --git a/inc/request-functions.php b/inc/request-functions.php
index a3bd5e3966..d7817ba0c9 100644
--- a/inc/request-functions.php
+++ b/inc/request-functions.php
@@ -117,7 +117,7 @@ function setGetRequestElement ($element, $value) {
}
// Wrapper for elements in $_POST
-function postRequestElement ($element, $subElement=null) {
+function postRequestElement ($element, $subElement = NULL) {
// By default no element is there
$value = NULL;
@@ -125,6 +125,7 @@ function postRequestElement ($element, $subElement=null) {
if (isset($GLOBALS['cache_request']['post'][$element][$subElement])) {
// Then use it
$value = $GLOBALS['cache_request']['post'][$element][$subElement];
+ //* DEBUG: */ print $element.'/'.$subElement.'='.$value.'
';
} elseif (isPostRequestElementSet($element)) {
// Then use it
$value = $GLOBALS['raw_request']['post'][$element];
@@ -133,12 +134,16 @@ function postRequestElement ($element, $subElement=null) {
if ((!is_null($subElement)) && (isPostRequestElementSet($element, $subElement))) {
// Then use this
$value = SQL_ESCAPE($value[$subElement]);
+ //* DEBUG: */ print 'sub!
';
} elseif (!is_array($value)) {
// Escape it here
$value = SQL_ESCAPE($value);
+ //* DEBUG: */ print 'no-array!
';
}
// Set it in cache
+ //* DEBUG: */ print $element.'/'.$subElement.'='.$value.'
';
+ //* DEBUG: */ print('
'.print_r($_POST,true).''); $GLOBALS['cache_request']['post'][$element][$subElement] = $value; } // END - if @@ -147,7 +152,7 @@ function postRequestElement ($element, $subElement=null) { } // Checks if an element in $_POST exists -function isPostRequestElementSet ($element, $subElement=null) { +function isPostRequestElementSet ($element, $subElement = NULL) { if (is_null($subElement)) { return ((isset($GLOBALS['raw_request']['post'][$element])) && (('' . $GLOBALS['raw_request']['post'][$element] . '') != '')); } else { @@ -247,5 +252,23 @@ function getRequestUri () { return $_SERVER['REQUEST_URI']; } +// Add all GET parameters to a string (without leading sign) +function addAllGetRequestParameters () { + // Init variable + $return = ''; + + // Now add all parameters + foreach (getRequestArray() as $key => $value) { + // Add it secured + $return .= SQL_ESCAPE($key) . '=' . SQL_ESCAPE($value) . '&'; + } // END - foreach + + // Remove trailing & + $return = substr($return, 0, -5); + + // Return it + return $return; +} + // [EOF] ?>