/i","..." />
PHPCMS v9过滤采集内容中CSS样式的实现方法
PHPCMS v9过滤采集内容中CSS样式的实现方法
发布时间:2016-12-23 来源:查字典编辑
摘要:方法如下:1、找到phpcmslibsfunctionsglobal.func.php打开,然后添加函数functionhtmrp($str...

方法如下:

1、找到phpcmslibsfunctionsglobal.func.php 打开,然后添加函数

function htmrp($str) {

$str = preg_replace("/<script[^>]*>/i", "", $str);

$str = preg_replace("/</script>/i", "", $str);

$str = preg_replace("/<iframe[^>]*>/i", "", $str);

$str = preg_replace("/</iframe>/i", "", $str);

$str = preg_replace("/<style[^>]*>/i", "", $str);

$str = preg_replace("/</style>/i", "", $str);

$str = preg_replace("/<div[^>]*>/i", "", $str);

$str = preg_replace("/</div>/i", "", $str);

return $str;

}

2、修改当前模板中文章内容页模板show.html

界面—模板风格—详情列表—content—show.html

找到

{if $allow_visitor==1}

{$content}

修改为

{if $allow_visitor==1}

{htmrp($content)}

3、更新缓存,刷新即可。

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新phpcms学习
热门phpcms学习
CMS教程子分类