]> git.mxchange.org Git - mailer.git/blobdiff - inc/request-functions.php
But only when it is not empty
[mailer.git] / inc / request-functions.php
index 62cdacc8c3f6e065f9e550750270a5ee04e2040f..6e20af72b077ec8e71b94d0f928838dc0c74c68d 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -90,7 +90,7 @@ function getRequestArray () {
 // Counts entries in $_GET or returns false if not an array
 function countRequestGet () {
        // By default this is not an array
-       $count = false;
+       $count = FALSE;
 
        // Get the array
        $GET = getRequestArray();
@@ -160,7 +160,8 @@ function isPostRequestElementSet ($element, $subElement = NULL) {
         * a string as numerical indexes are not wanted in POST data (in this
         * project).
         */
-       assert(is_string($element) && ((is_null($subElement)) || (is_string($subElement))));
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element[]=' . gettype($element) . ',subElement[]=' . gettype($subElement));
+       assert(is_string($element) && ((is_null($subElement)) || (is_string($subElement)) || (is_int($subElement)) || (is_double($subElement))));
 
        // Is a sub element set?
        if (is_null($subElement)) {
@@ -191,7 +192,7 @@ function setPostRequestArray ($postData) {
 // Counts entries in $_POST or returns false if not an array
 function countRequestPost () {
        // By default this is not an array
-       $count = false;
+       $count = FALSE;
 
        // Get the array
        $postData = postRequestArray();
@@ -228,16 +229,22 @@ function setPostRequestElement ($element, $value) {
                // Value is an array so set it directly
                $GLOBALS['raw_request']['post'][$element] = $value;
        } else {
+               // Debug message
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',value=' . $value . ' - BEFORE!');
+
                // Escape both
                $element = SQL_ESCAPE($element);
                $value   = SQL_ESCAPE($value);
 
+               // Debug message
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',value=' . $value . ' - AFTER!');
+
                // Set regular entry
                $GLOBALS['raw_request']['post'][$element] = $value;
        }
 
        // Update cache
-       $GLOBALS['cache_request']['post'][$element][null] = $value;
+       $GLOBALS['cache_request']['post'][$element][NULL] = $value;
 }
 
 // Checks whether a form was sent. If so, the $_POST['ok'] element must be set