{ $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } /* Make sure we aren't getting screwed over by magic quotes. */ if (get_magic_quotes_runtime()) { set_magic_quotes_runtime(0); } if (get_magic_quotes_gpc()) { include_once './lib/ArrayUtility.php'; $_GET = array_map('stripslashes_deep', $_GET); $_POST = array_map('stripslashes_deep', $_POST); $_REQUEST = array_map('stripslashes_deep', $_REQUEST); $_GET = ArrayUtility::arrayMapKeys('stripslashes_deep', $_GET); $_POST = ArrayUtility::arrayMapKeys('stripslashes_deep', $_POST); $_REQUEST = ArrayUtility::arrayMapKeys('stripslashes_deep', $_REQUEST); } /* Objects can't be stored in the session if session.auto_start is enabled. */ if (ini_get('session.auto_start') !== '0' && ini_get('session.auto_start') !== 'Off') { die('CATS Error: session.auto_start must be set to 0 in php.ini.'); } /* Proper extensions loaded?! */ if (!function_exists('mysql_connect') || !function_exists('session_start')) { die('CATS Error: All required PHP extensions are not loaded.'); } /* Make sure we have a Session object stored in the user's session. */ if (!isset($_SESSION['CATS']) || empty($_SESSION['CATS'])) { $_SESSION['CATS'] = new CATSSession(); } /* Start timer for measuring server response time. Displayed in footer. */ $_SESSION['CATS']->startTimer();