]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/security_functions.php
Deprecated config.php removed. Please wait for further commits with an included fall...
[mailer.git] / inc / libs / security_functions.php
index aad7abbded90ed1ba31e6aa707c50cce24eb3672..6e1084ce94a7c7181b4e5664ad049cb494260291 100644 (file)
@@ -38,7 +38,7 @@
 
 // Some security stuff...
 if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
-       $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);
 }
 
@@ -90,7 +90,7 @@ if (!isset($_POST)) {
 // Generate arrays which holds the relevante chars to replace
 $GLOBALS['security_chars'] = array(
        // The chars we are looking for...
-       'from' => array("{", "}", "/", ".", "'", "$", "(", ")", '{--', '--}', "%", ';', "[", "]", ":", "--"),
+       'from' => array("{", "}", '/', '.', "'", "$", '(', ')', '{--', '--}', "%", ';', "[", "]", ':', "--"),
        // ... and we will replace to.
        'to'   => array(
                "{OPEN_ANCHOR2}",
@@ -120,7 +120,7 @@ $GLOBALS['url_chars'] = array(
        // Search for these secured characters
        'to'   => array("{SLASH}", "{DOT}", "{PER}", "{DBL_DOT}", "{COMMENT}"),
        // Replace with these characters
-       'from' => array("/", ".", "%", ":", "--")
+       'from' => array('/', '.', "%", ':', "--")
 );
 
 // Overworked security part:
@@ -163,15 +163,15 @@ if (!defined('_OB_CACHING')) {
        if (phpversion() >= '4.0.4pl1' && (strstr(getenv('HTTP_USER_AGENT'),'compatible') || (strstr(getenv('HTTP_USER_AGENT'), "Mozilla")))) {
                if ((extension_loaded('zlib')) && (function_exists('ob_start'))) {
                        // Start caching
-                       define('_OB_CACHING', "on");
+                       define('_OB_CACHING', 'on');
                        ob_start();
                } else {
                        // Extension not loaded or required function is missing
-                       define('_OB_CACHING', "404");
+                       define('_OB_CACHING', '404');
                }
        } else {
                // Old PHP version
-               define('_OB_CACHING', "old");
+               define('_OB_CACHING', 'old');
        }
 }
 
@@ -183,9 +183,9 @@ $SELF_DIR  = dirname($_SERVER['PHP_SELF']);
 $SELF_FILE = basename($_SERVER['PHP_SELF']);
 
 // Check for a .php inside the $SELF_DIR...
-while (ereg(".php", $SELF_DIR)) {
+while (ereg('.php', $SELF_DIR)) {
        // Correct the dirname
-       $SELF_DIR = substr($SELF_DIR, 0, (strpos($SELF_DIR, ".php") + 4));
+       $SELF_DIR = substr($SELF_DIR, 0, (strpos($SELF_DIR, '.php') + 4));
        // Rewrite filename...
        $SELF_FILE = basename($SELF_DIR);
        // ... and dirname
@@ -193,14 +193,14 @@ while (ereg(".php", $SELF_DIR)) {
 }
 
 // Put both together again and let's pray it is secured now...
-$_SERVER['PHP_SELF'] = $SELF_DIR."/".$SELF_FILE;
+$_SERVER['PHP_SELF'] = $SELF_DIR.'/'.$SELF_FILE;
 
 // Remove uneccessary variables
 unset($SELF_DIR);
 unset($SELF_FILE);
 
 // Security system loaded...
-define('__SECURITY', "1");
+define('__SECURITY', '1');
 
 //
 ?>