php - 怎样关掉kindeditor表单提交的时候对' " < >的自动转义?
阿神
阿神 2017-04-11 09:11:58
0
1
400

图上的几个字段是表单,其中content1是kindeditor提交的内容,原文内容是来几个符号'<">\ 用firebug一看,变成了上图的样子。

说明kindeditor在提交前,已经自动做了类似php的htmlspecialchars,将<和>这样的符号转成html转义码。

很贴心的功能,不过用的时候要注意。

阿神
阿神

闭关修行中......

Antworte allen(1)
洪涛

KindEditor 默认采用白名单过滤方式,可用 htmlTags 参数定义要保留的标签和属性。当然也可以用 filterMode 参数关闭过滤模式,保留所有标签。

KindEditor.ready(function(K) {
                K.create('textarea[name="content"]', {
                    filterMode : false
                });
            });

然而,这并不能取代后端的过滤,因为前段的处理可以被绕过。

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!