X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Frequest-functions.php;h=c4afd304a919d52d64ef19dbbf0f4d8a7185ffe4;hb=4fef71140a7d5faeaff256ab7c5bf4616c671f63;hp=6a17a3c324f01f4f79c86b8e66a2c8eb34427cc4;hpb=d6763de46a753a7e28cae188ea75dea168abc251;p=mailer.git diff --git a/inc/request-functions.php b/inc/request-functions.php index 6a17a3c324..c4afd304a9 100644 --- a/inc/request-functions.php +++ b/inc/request-functions.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -156,7 +156,8 @@ function postRequestElement ($element, $subElement = NULL) { // Checks if an element in $_POST exists function isPostRequestElementSet ($element, $subElement = NULL) { if (is_null($subElement)) { - return ((isset($GLOBALS['raw_request']['post'][$element])) && (('' . $GLOBALS['raw_request']['post'][$element] . '') != '')); + if (!is_string($element)) die(gettype($element)); + return ((isset($GLOBALS['raw_request']['post'][$element])) && ((is_array($GLOBALS['raw_request']['post'][$element])) || (('' . $GLOBALS['raw_request']['post'][$element] . '') != ''))); } else { return ((isset($GLOBALS['raw_request']['post'][$element][$subElement])) && (('' . $GLOBALS['raw_request']['post'][$element][$subElement] . '') != '')); } @@ -230,29 +231,21 @@ function setPostRequestElement ($element, $value) { $GLOBALS['cache_request']['post'][$element][null] = $value; } -// Checks wether a form was sent. If so, the $_POST['ok'] element must be set +// Checks whether a form was sent. If so, the $_POST['ok'] element must be set function isFormSent ($requestParameter = 'ok') { // Simply wrap it! return isPostRequestElementSet($requestParameter); } -// Checks if 'content_type' is set -function isContentTypeSet () { - return isset($GLOBALS['content_type']); -} - -// Setter for content type -function setContentType ($contentType) { - $GLOBALS['content_type'] = (string) $contentType; -} - -// Getter for content type -function getContentType () { - return $GLOBALS['content_type']; -} - // Getter for request URI function getRequestUri () { + // Is it not set? + if (!isset($_SERVER['REQUEST_URI'])) { + // Return empty string + return ''; + } // END - if + + // Return it return $_SERVER['REQUEST_URI']; }