X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Frequest-functions.php;h=b8f862fee9011d8409d4da0675298e8cd362ec87;hp=60a1addea0b10dc328f6b99c73738b245c505260;hb=d43eb5dde3d31d2db3823595ea6d57880f3874cd;hpb=414570c5081d337bb6c28dcf521bd8bca02f69e7 diff --git a/inc/request-functions.php b/inc/request-functions.php index 60a1addea0..b8f862fee9 100644 --- a/inc/request-functions.php +++ b/inc/request-functions.php @@ -10,10 +10,10 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Spezialle Funktionen fuer die Anfragebehandlung * * -------------------------------------------------------------------- * - * $Revision:: 856 $ * - * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. Mär 2009) $ * + * $Revision:: $ * + * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * - * $Author:: stelzi $ * + * $Author:: $ * * Needs to be in all Files and every File needs "svn propset * * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * @@ -38,7 +38,7 @@ // Some security stuff... if (!defined('__SECURITY')) { - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; + $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php'; require($INC); } // END - if @@ -64,11 +64,11 @@ function REQUEST_GET ($element) { } // Checks if an element in $_GET exists -function REQUEST_ISSET_GET ($element, $extra="") { - if (empty($extra)) { - return (isset($_GET[$element])); +function REQUEST_ISSET_GET ($element, $subElement="") { + if (empty($subElement)) { + return ((isset($_GET[$element])) && (!empty($_GET[$element]))); } else { - return (isset($_GET[$element][$extra])); + return ((isset($_GET[$element][$subElement])) && (!empty($_GET[$element][$subElement]))); } } @@ -105,7 +105,7 @@ function REQUEST_SET_GET ($element, $value) { } // Wrapper for elements in $_POST -function REQUEST_POST ($element) { +function REQUEST_POST ($element, $subElement=null) { // By default no element is there $value = null; @@ -113,6 +113,12 @@ function REQUEST_POST ($element) { if (REQUEST_ISSET_POST($element)) { // Then use it $value = $_POST[$element]; + + // Is $subElement set? + if ((!is_null($subElement)) && (REQUEST_ISSET_POST($element, $subElement))) { + // Then use this + $value = $value[$subElement]; + } // END - if } // END - if // Return value @@ -120,11 +126,11 @@ function REQUEST_POST ($element) { } // Checks if an element in $_POST exists -function REQUEST_ISSET_POST ($element, $extra="") { - if (empty($extra)) { - return (isset($_POST[$element])); +function REQUEST_ISSET_POST ($element, $subElement=null) { + if (is_null($subElement)) { + return ((isset($_POST[$element])) && (!empty($_POST[$element]))); } else { - return (isset($_POST[$element][$extra])); + return ((isset($_POST[$element][$subElement])) && (!empty($_POST[$element][$subElement]))); } }