function _sanitise_environment() { if (TIMEZONE) { date_default_timezone_set(TIMEZONE); } if (DEBUG) { error_reporting(E_ALL); } if (CONTEXT) { ctx_set_log(CONTEXT); ctx_log_start(@$_SERVER["REQUEST_URI"], true, true); } if (COVERAGE) { _start_coverage(); register_shutdown_function("_end_coverage"); } assert_options(ASSERT_ACTIVE, 1); assert_options(ASSERT_BAIL, 1); ob_start(); if (get_magic_quotes_gpc()) { $_GET = _stripslashes_r($_GET); $_POST = _stripslashes_r($_POST); $_COOKIE = _stripslashes_r($_COOKIE); } if (is_cli()) { if (isset($_SERVER['REMOTE_ADDR'])) { die("CLI with remote addr? Confused, not taking the risk."); } $_SERVER['REMOTE_ADDR'] = "0.0.0.0"; $_SERVER['HTTP_HOST'] = "<cli command>"; } }
function _sanitise_environment() { if (DEBUG) { error_reporting(E_ALL); assert_options(ASSERT_ACTIVE, 1); assert_options(ASSERT_BAIL, 1); } ob_start(); if (get_magic_quotes_gpc()) { $_GET = _stripslashes_r($_GET); $_POST = _stripslashes_r($_POST); $_COOKIE = _stripslashes_r($_COOKIE); } }