]> git.mxchange.org Git - mailer.git/blobdiff - inc/request-functions.php
Parser error fixed and should be span instead of div, TODOs.txt updated
[mailer.git] / inc / request-functions.php
index ae98c4efe5904170c0e1cd817546a17c8052b128..c50fa5558c209e13fa26a795163c1473ff6f02b7 100644 (file)
@@ -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, $subElement="") {
+function REQUEST_ISSET_GET ($element, $subElement = '') {
        if (empty($subElement)) {
-               return (isset($_GET[$element]));
+               return ((isset($_GET[$element])) && (!empty($_GET[$element])));
        } else {
-               return (isset($_GET[$element][$subElement]));
+               return ((isset($_GET[$element][$subElement])) && (!empty($_GET[$element][$subElement])));
        }
 }
 
@@ -128,9 +128,9 @@ function REQUEST_POST ($element, $subElement=null) {
 // Checks if an element in $_POST exists
 function REQUEST_ISSET_POST ($element, $subElement=null) {
        if (is_null($subElement)) {
-               return (isset($_POST[$element]));
+               return ((isset($_POST[$element])) && (!empty($_POST[$element])));
        } else {
-               return (isset($_POST[$element][$subElement]));
+               return ((isset($_POST[$element][$subElement])) && (!empty($_POST[$element][$subElement])));
        }
 }
 
@@ -163,12 +163,13 @@ function REQUEST_POST_COUNT () {
 
 // Setter for element in $_POST
 function REQUEST_SET_POST ($element, $value) {
+       // Is $element or $value an array?
        if (is_array($element)) {
                // Set array
                $eval = "\$_POST['";
 
                // Add all entries
-               $eval .= implode("''", $element);
+               $eval .= implode("']['", $element);
 
                // Finish eval() command
                $eval .= sprintf("'] = \"%s\";", SQL_ESCAPE($value));
@@ -185,7 +186,7 @@ function REQUEST_SET_POST ($element, $value) {
 }
 
 // Checks wether a form was sent. If so, the $_POST['ok'] element must be set
-function IS_FORM_SENT () {
+function isFormSent () {
        // Simply wrap it!
        return REQUEST_ISSET_POST('ok');
 }