= '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 $GLOBALS['php_caching'] = 'on'; ob_start(); } else { // Extension not loaded or required function is missing $GLOBALS['php_caching'] = '404'; } } else { // Old PHP version $GLOBALS['php_caching'] = 'old'; } } // Runtime/GPC quoting is off now... ini_set('magic_quotes_runtime', false); ini_set('magic_quotes_gpc', false); // This may not work on some systems // No compatibility with Zend Engine 1, else an error like 'Implicit cloning' // will be produced. if (phpversion() >= '5.0') { ini_set('zend.ze1_compatibility_mode', 'Off'); } // END - if // Check if important arrays are found and define them if missing if (!isset($_SERVER)) { global $_SERVER; $_SERVER = $GLOBALS['_SERVER']; } // END - if if (!isset($_GET)) { global $_GET; $_GET = $GLOBALS['_GET']; } // END - if if (!isset($_POST)) { global $_POST; $_POST = $GLOBALS['_POST']; } // END - if // Generate arrays which holds the relevante chars to replace $GLOBALS['security_chars'] = array( // The chars we are looking for... 'from' => array('/', '.', "'", '$', '(', ')', '{--', '--}', '{?', '?}', '%', ';', '[', ']', ':', '--'), // ... and we will replace to. 'to' => array( '{SLASH}', '{DOT}', '{QUOT}', '{DOLLAR}', '{OPEN_ANCHOR}', '{CLOSE_ANCHOR}', '{OPEN_TEMPLATE}', '{CLOSE_TEMPLATE}', '{OPEN_CONFIG}', '{CLOSE_CONFIG}', '{PER}', '{SEMI}', '{OPEN_INDEX}', '{CLOSE_INDEX}', '{DBL_DOT}', '{COMMENT}' ), ); // Characters allowed in URLs // // Note: Do not replace 'to' with 'from' and vise-versa! When you do this all booked URLs will be // rejected because of the {SLASH}, {DOT} and all below listed items inside the URL. $GLOBALS['url_chars'] = array( // Search for these secured characters 'to' => array('{SLASH}', '{DOT}', '{PER}', '{DBL_DOT}', '{COMMENT}'), // Replace with these characters 'from' => array('/', '.', '%', ':', '--') ); // Overworked security part: if (is_array($_GET)) { foreach ($_GET as $seckey => $secvalue) { if (is_array($secvalue)) { // Throw arrays away... unset($_GET[$seckey]); } else { // Only variables are allowed (non-array) but we secure them all! $_GET[$seckey] = str_replace($GLOBALS['security_chars']['from'], $GLOBALS['security_chars']['to'], $_GET[$seckey]); // Strip all other out $_GET[$seckey] = secureString($_GET[$seckey]); } } // END - foreach } // END - if // Detect PHP caching detectPhpCaching(); // At last secure the $_SERVER['PHP_SELF'] element securePhpSelf(); // Security system loaded... define('__SECURITY', 1); // [EOF] ?>