thinkphp过滤html、script

使用tp3.1版本

1、APP/common 自定义函数

function filter_default(&$value){
$value = htmlspecialchars($value);
}

 

2、config配置默认过滤器

'VAR_FILTERS'=>'filter_default,filter_exp'

 

参见

http://www.thinkphp.cn/document/308.html

 

3、显示时使用 &lt; - > '<' 则使用

{$vo.content|htmlspecialchars_decode}

参见

http://blog.csdn.net/losetowin/article/details/7292709

posted on 2014-04-18 11:10  yun007  阅读(6604)  评论(0编辑  收藏  举报