X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Frequest-functions.php;h=6237299a4a975e7d33e70274de3e65375c625945;hb=b47f7363125a751ecd04146fc82b11bb7b050d00;hp=c417c560c181513974a915614703557b19d87e87;hpb=bc72f913ef9ef26f4103d3deddb4d8be5337a1e5;p=mailer.git diff --git a/inc/request-functions.php b/inc/request-functions.php index c417c560c1..6237299a4a 100644 --- a/inc/request-functions.php +++ b/inc/request-functions.php @@ -18,6 +18,7 @@ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * + * Copyright (c) 2009, 2010 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -48,7 +49,7 @@ function initRequest () { } // Wrapper for elements in $_GET -function getRequestElement ($element) { +function getRequestParameter ($element) { // By default no element is there $value = null; @@ -56,7 +57,7 @@ function getRequestElement ($element) { if (isset($GLOBALS['cache_request']['request_get'][$element])) { // Then use the cache $value = $GLOBALS['cache_request']['request_get'][$element]; - } elseif (isGetRequestElementSet($element)) { + } elseif (isGetRequestParameterSet($element)) { // Then get it directly $value = SQL_ESCAPE($GLOBALS['raw_request']['get'][$element]); @@ -69,7 +70,7 @@ function getRequestElement ($element) { } // Checks if an element in $_GET exists -function isGetRequestElementSet ($element, $subElement = '') { +function isGetRequestParameterSet ($element, $subElement = '') { if (empty($subElement)) { return ((isset($GLOBALS['raw_request']['get'][$element])) && (!empty($GLOBALS['raw_request']['get'][$element]))); } else { @@ -78,7 +79,7 @@ function isGetRequestElementSet ($element, $subElement = '') { } // Removes an element from $_GET -function unsetGetRequestElement ($element) { +function unsetGetRequestParameter ($element) { unset($GLOBALS['raw_request']['get'][$element]); } @@ -105,7 +106,7 @@ function countRequestGet () { } // Setter for element in $_GET -function setGetRequestElement ($element, $value) { +function setGetRequestParameter ($element, $value) { // Escape both $element = SQL_ESCAPE($element); $value = SQL_ESCAPE($value); @@ -118,7 +119,7 @@ function setGetRequestElement ($element, $value) { } // Wrapper for elements in $_POST -function postRequestElement ($element, $subElement=null) { +function postRequestParameter ($element, $subElement=null) { // By default no element is there $value = null; @@ -126,12 +127,12 @@ function postRequestElement ($element, $subElement=null) { if (isset($GLOBALS['cache_request']['request_post'][$element][$subElement])) { // Then use it $value = $GLOBALS['cache_request']['request_post'][$element][$subElement]; - } elseif (isPostRequestElementSet($element)) { + } elseif (isPostRequestParameterSet($element)) { // Then use it $value = $GLOBALS['raw_request']['post'][$element]; // Is $subElement set? - if ((!is_null($subElement)) && (isPostRequestElementSet($element, $subElement))) { + if ((!is_null($subElement)) && (isPostRequestParameterSet($element, $subElement))) { // Then use this $value = SQL_ESCAPE($value[$subElement]); } elseif (!is_array($value)) { @@ -148,7 +149,7 @@ function postRequestElement ($element, $subElement=null) { } // Checks if an element in $_POST exists -function isPostRequestElementSet ($element, $subElement=null) { +function isPostRequestParameterSet ($element, $subElement=null) { if (is_null($subElement)) { return ((isset($GLOBALS['raw_request']['post'][$element])) && (isset($GLOBALS['raw_request']['post'][$element]))); } else { @@ -157,7 +158,7 @@ function isPostRequestElementSet ($element, $subElement=null) { } // Removes an element from $_POST -function unsetPostRequestElement ($element) { +function unsetPostRequestParameter ($element) { unset($GLOBALS['raw_request']['post'][$element]); } @@ -189,7 +190,7 @@ function countRequestPost () { } // Setter for element in $_POST -function setPostRequestElement ($element, $value) { +function setPostRequestParameter ($element, $value) { // Is $element or $value an array? if (is_array($element)) { // Set array @@ -223,9 +224,14 @@ function setPostRequestElement ($element, $value) { } // Checks wether a form was sent. If so, the $_POST['ok'] element must be set -function isFormSent () { +function isFormSent ($requestParameter = 'ok') { // Simply wrap it! - return isPostRequestElementSet('ok'); + return isPostRequestParameterSet($requestParameter); +} + +// Checks if 'content_type' is set +function isContentTypeSet () { + return isset($GLOBALS['content_type']); } // Setter for content type