]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/security_functions.php
Cache init fixed
[mailer.git] / inc / libs / security_functions.php
index 8c032b722af6bf1c0ae399a9125e7d755e044275..190a369e5abebcde7f3e28004fbfb23aba3a7d41 100644 (file)
@@ -76,10 +76,10 @@ if (!isset($_POST))
        global $_POST;
        $_POST = $GLOBALS['_POST'];
 }
-if (!isset($_SESSION))
+if (!isset($_COOKIE))
 {
-       global $_SESSION;
-       $_SESSION = $GLOBALS['_COOKIE'];
+       global $_COOKIE;
+       $_COOKIE = $GLOBALS['_COOKIE'];
 }
 
 // Include IP-Filter here
@@ -89,14 +89,14 @@ if (!isset($_SESSION))
 global $SEC_CHARS, $URL_CHARS;
 $SEC_CHARS = array(
        // The chars we are looking for...
-       'from' => array("{", "}", "/", ".", "'", "$", "(", ")", "{--", "--}", "%", ";", "[", "]", ":", "--"),
+       'from' => array("{", "}", "/", ".", "'", "$", "(", ")", '{--', '--}', "%", ";", "[", "]", ":", "--"),
        // ... and we will replace to.
        'to'   => array(
                "{OPEN_ANCHOR2}",
                "{CLOSE_ANCHOR2}",
                "{SLASH}",
                "{DOT}",
-               "{QUOT}",
+               '{QUOT}',
                "{DOLLAR}",
                "{OPEN_ANCHOR}",
                "{CLOSE_ANCHOR}",
@@ -166,12 +166,12 @@ if (basename($_SERVER['PHP_SELF']) != "install.php")
        }
 
        // ... and finally cookies
-       foreach ($_SESSION as $seckey=>$secvalue)
+       foreach ($_COOKIE as $seckey=>$secvalue)
        {
                if (is_array($secvalue))
                {
                        // Throw arrays away...
-                       unset($_SESSION[$seckey]);
+                       unset($_COOKIE[$seckey]);
                }
                 else
                {
@@ -179,11 +179,11 @@ if (basename($_SERVER['PHP_SELF']) != "install.php")
                        foreach ($SEC_CHARS['from'] as $key=>$char)
                        {
                                // Pass all through
-                               $_SESSION[$seckey] = str_replace($char  , $SEC_CHARS['to'][$key], $_SESSION[$seckey]);
+                               $_COOKIE[$seckey] = str_replace($char  , $SEC_CHARS['to'][$key], $_COOKIE[$seckey]);
                        }
 
                        // Strip all other out
-                       $_SESSION[$seckey] = strip_tags($_SESSION[$seckey]);
+                       $_COOKIE[$seckey] = strip_tags($_COOKIE[$seckey]);
                }
        }
 }