]> git.mxchange.org Git - mailer.git/blobdiff - inc/session-functions.php
Updated copyright year.
[mailer.git] / inc / session-functions.php
index 8feefa3302c17793a901c93630028fd90add42fb..e1dff3de408cdfb6b00ff983ba70fb9eb2baaf41 100644 (file)
@@ -11,7 +11,7 @@
  * Kurzbeschreibung  : Sitzungsrelevante Funktionen                     *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -45,10 +45,15 @@ function setSession ($var, $value) {
 
        // Trim value and session variable
        $var   = trim(secureString($var));
-       $value = trim($value);
+
+       // Is the value no array?
+       if (!is_array($value)) {
+               // Then trim it
+               $value = trim($value);
+       } // END - if
 
        // Is the session variable set?
-       if (('' . $value . '' == '') && (isSessionVariableSet($var))) {
+       if ((!is_array($value)) && ('' . $value . '' == '') && (isSessionVariableSet($var))) {
                // Remove the session
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'UNSET:' . $var . '=' . getSession($var));
                unset($_SESSION[$var]);
@@ -59,7 +64,7 @@ function setSession ($var, $value) {
                        // PHP version < 5.3.0
                        return session_unregister($var);
                }
-       } elseif (('' . $value . '' != '') && (!isSessionVariableSet($var))) {
+       } elseif ((is_array($value)) || (('' . $value . '' != '') && (!isSessionVariableSet($var)))) {
                // Set session
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SET:' . $var . '=' . $value);
                $_SESSION[$var] = $value;