bucuo123 发表于 2019-3-24 16:13:00

PHPCMS v9过滤采集内容中CSS样式的实现方法

PHPCMS v9过滤采集内容中CSS样式的实现方法
方法如下:
  1、找到\phpcms\libs\functions\global.func.php 打开,然后添加函数
复制代码代码如下:
function htmrp($str) {
       $str = preg_replace("/]*>/i", "", $str);   
       $str = preg_replace("//i", "", $str);
       $str = preg_replace("/[i,,*>/i", "", $str);   
       $str = preg_replace("//i", "", $str);
       $str = preg_replace("/]*>/i", "", $str);   
       $str = preg_replace("//i", "", $str);
       $str = preg_replace("/]*>/i", "", $str);   
       $str = preg_replace("//i", "", $str);
       return $str;
}
2、修改当前模板中文章内容页模板show.html
  界面—模板风格—详情列表—content—show.html
  找到
{if $allow_visitor==1}
   {$content}
  修改为
复制代码代码如下:
{if $allow_visitor==1}
{htmrp($content)}
  3、更新缓存,刷新即可。
页: [1]
查看完整版本: PHPCMS v9过滤采集内容中CSS样式的实现方法