最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ecshop递归过滤get,post函数的程序代码
时间:2022-06-24 15:45:23 编辑:袖梨 来源:一聚教程网
/**
* 递归方式的对变量中的特殊字符进行转义
*
* @access public
* @param mix $value
*
* @return mix
*/
function addslashes_deep($value)
{
if (empty($value))
{
return $value;
}
else
{
return is_array($value) ? array_map('addslashes_deep', $value) : addslashes($value);
}
}
使用:
/* 对用户传入的变量进行转义操作。*/
if (!get_magic_quotes_gpc())
{
if (!empty($_GET))
{
$_GET = addslashes_deep($_GET);
}
if (!empty($_POST))
{
$_POST = addslashes_deep($_POST);
}
$_COOKIE = addslashes_deep($_COOKIE);
$_REQUEST = addslashes_deep($_REQUEST);
}
相关文章
- 会计随身学如何注销账号 04-19
- QQ邮箱网页版主页链接是什么 04-19
- 如何删除wps页面 04-19
- 手机微博网页版如何看热搜 04-19
- 儿歌多多如何查看个人音频 04-19
- 东呈会积分如何抽奖 04-19