X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Frequest-functions.php;h=ee70e614020d7d2810a1819d4b6c9d230934aad5;hb=3b7adf43576db24e516716bb13a2bd0bac677c8c;hp=c417c560c181513974a915614703557b19d87e87;hpb=bc72f913ef9ef26f4103d3deddb4d8be5337a1e5;p=mailer.git diff --git a/inc/request-functions.php b/inc/request-functions.php index c417c560c1..ee70e61402 100644 --- a/inc/request-functions.php +++ b/inc/request-functions.php @@ -14,10 +14,9 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -43,12 +42,12 @@ if (!defined('__SECURITY')) { // Initialize the request elements function initRequest () { - $GLOBALS['raw_request']['get'] = $_GET; - $GLOBALS['raw_request']['post'] = $_POST; + $GLOBALS['raw_request']['get'] = (array) $_GET; + $GLOBALS['raw_request']['post'] = (array) $_POST; } // Wrapper for elements in $_GET -function getRequestElement ($element) { +function getRequestParameter ($element) { // By default no element is there $value = null; @@ -56,7 +55,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 +68,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 +77,7 @@ function isGetRequestElementSet ($element, $subElement = '') { } // Removes an element from $_GET -function unsetGetRequestElement ($element) { +function unsetGetRequestParameter ($element) { unset($GLOBALS['raw_request']['get'][$element]); } @@ -105,7 +104,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 +117,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 +125,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 +147,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 +156,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 +188,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 +222,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