Phpcms V9内容编辑器过滤不支持iframe和JavaScript的解决办法

 在网上找过很多的办法试着来解决的在 phpcms的内容编辑器 下标签 iframe和JavaScript 被过滤的问题,结果都不能如愿以偿。
然后再接下来的几天里面。我去把phpcms\libs\functions\global.func.php中的函数函数文件都看了一遍,终于找到了问题所在。
发现149行的  trim_script()这个函数转定义了标签,于是乎注释掉。
 $val){ 
            $str[$key] = trim_script($val); 
        } 
    }else{ 
        $str = preg_replace ( '/\<([\/]?)script([^\>]*?)\>/si','<\\script\\2>',$str ); 
        $str = preg_replace ( '/\<([\/]?)iframe([^\>]*?)\>/si','<\\iframe\\2>',$str ); 
        $str = preg_replace ( '/\<([\/]?)frame([^\>]*?)\>/si','<\\frame\\2>',$str ); 
        $str = str_replace ( 'javascript:','javascript:',$str ); 
    } 
    return $str; 
} 
修改成
 $val){ 
            $str[$key] = trim_script($val); 
        } 
    }else{ 
        //$str = preg_replace ( '/\<([\/]?)script([^\>]*?)\>/si',$str ); 
        //$str = preg_replace ( '/\<([\/]?)iframe([^\>]*?)\>/si',$str ); 
        //$str = preg_replace ( '/\<([\/]?)frame([^\>]*?)\>/si',$str ); 
    } 
    return $str; 
} 
然后再到内容 编辑器里面去插入  iframe或者JavaScript 看看吧。是不是能成功的插入了呢!

相关文章

本教程操作系统:Windows10系统、phpcms 9版本、Dell G3电脑...
PHPcms访问特点:单一入口模式。无论访问任何一个模块或者功...
例如:{pc:contentaction="position"posid="...
首先,上图之中的红色框框是没有的,我们想要给他加上,当然...
头部<metaname="keywords"content="{$SEO...
做网站时用的到的简单的栏目导航()phpcms多个栏目catidin(9,...