PHPCMS v9过滤采集内容中CSS样式的实现方法
来源:本站原创|时间:2022-11-25|栏目:phpcms|
方法如下:
1、找到\phpcms\libs\functions\global.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、更新缓存,刷新即可。
您可能感兴趣的文章
- 01-10phpcms常见问题解答
- 01-10phpcms语法规则
- 01-10PHPCMS网站转移空间教程
- 01-10PHPCMS2008 SP4 心情排行指数不显示的解决办法
- 01-10phpcms频道首页调用所有一级栏目及二级栏目
- 01-10phpcms标签模板及专题模板的制作
- 01-10PHPCMS系统自带标签说明
- 01-10为PHPCMS 2008 编辑器增加常用中文字体方法
- 01-10PHPcms 2008 注册选择模型关闭后,注册不能自动登录的问题
- 01-10phpcms模仿QQ和MSN消息提示的效果