// 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);
}
// 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}",
// Search for these secured characters
'to' => array("{SLASH}", "{DOT}", "{PER}", "{DBL_DOT}", "{COMMENT}"),
// Replace with these characters
- 'from' => array("/", ".", "%", ":", "--")
+ 'from' => array('/', '.', "%", ':', "--")
);
// Overworked security part:
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');
}
}
$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
}
// 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');
//
?>