最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 有效安全过滤get,posd,cookie
时间:2022-07-02 10:35:52 编辑:袖梨 来源:一聚教程网
session_set_cookie_params(0, COOKIE_PATH, COOKIE_DOMAIN);
if($_REQUEST)
{
if(MAGIC_QUOTES_GPC)
{
$_REQUEST = new_stripslashes($_REQUEST);
if($_COOKIE) $_COOKIE = new_stripslashes($_COOKIE);
}
else
{
$_POST = new_addslashes($_POST);
$_GET = new_addslashes($_GET);
$_COOKIE = new_addslashes($_COOKIE);
@extract($_POST);
@extract($_GET);
@extract($_COOKIE);
}
if(!defined('IN_ADMIN')) $_REQUEST = filter_xss($_REQUEST, ALLOWED_HTMLTAGS);
extract($db->escape($_REQUEST), EXTR_SKIP);
if($_COOKIE) $db->escape($_COOKIE);
}
if(QUERY_STRING && strpos(QUERY_STRING, '=') === false && preg_match("/^(.*).(htm|html|shtm|shtml)$/", QUERY_STRING, $urlvar))
{
parse_str(str_replace(array('/', '-', ' '), array('&', '=', ''), $urlvar[1]));
}