} /* end of init functions */ if (!get_magic_quotes_gpc()) { foreach ($_GET as $key => $val) { $_GET[$key] = pl_addslashes($_GET[$key]); } foreach ($_POST as $key => $val) { $_POST[$key] = pl_addslashes($_POST[$key]); } foreach ($_COOKIE as $key => $val) { $_COOKIE[$key] = pl_addslashes($_COOKIE[$key]); } foreach ($_SERVER as $key => $val) { $_SERVER[$key] = pl_addslashes($_SERVER[$key]); } } $c_script_filename = __FILE__; $c_php_self = $_SERVER['PHP_SELF']; $c_http_host = $_SERVER['HTTP_HOST']; // base application directory $apps_path['base'] = dirname($c_script_filename); // base application http path $http_path['base'] = ($core_config['ishttps'] ? "https://" : "http://") . $c_http_host . (dirname($c_php_self) == '/' ? '/' : dirname($c_php_self)); // libraries directory $apps_path['libs'] = $apps_path['base'] . '/lib'; $http_path['libs'] = $http_path['base'] . '/lib'; // core plugins directories $apps_path['incs'] = $apps_path['base'] . '/inc'; $http_path['incs'] = $http_path['base'] . '/inc';
function pl_addslashes($data) { global $db_param; if (is_array($data)) { foreach ($data as &$datum) { $datum = pl_addslashes($datum); } } else { if ($db_param[type] == "mssql") { $data = str_replace("'", "''", $data); } else { $data = addslashes($data); } } return $data; }