Home > Backend Development > PHP Tutorial > How to turn off the automatic escaping of ' ' < > when submitting a kindeditor form?

How to turn off the automatic escaping of ' ' < > when submitting a kindeditor form?

WBOY
Release: 2016-08-04 09:21:09
Original
1309 people have browsed it

How to turn off the automatic escaping of ' ' < > when submitting a kindeditor form?

Several fields in the picture are forms, among which content1 is the content submitted by kindeditor. The original content is Come with a few symbols '<"> Use firebug to see that it looks like the picture above.

Explain that kindeditor has automatically made htmlspecialchars similar to php before submitting, converting symbols like < and > into html escape codes.

It’s a very considerate function, but you need to be careful when using it.

Reply content:

How to turn off the automatic escaping of ' ' < > when submitting a kindeditor form?

Several fields in the picture are forms, among which content1 is the content submitted by kindeditor. The original content is Come with a few symbols '<"> Use firebug to see that it looks like the picture above.

Explain that kindeditor has automatically made htmlspecialchars similar to php before submitting, converting symbols like < and > into html escape codes.

It’s a very considerate function, but you need to be careful when using it.

KindEditor uses whitelist filtering by default, and you can use the htmlTags parameter to define the tags and attributes to be retained. Of course, you can also use the filterMode parameter to turn off the filter mode and retain all tags.

<code class="js">KindEditor.ready(function(K) {
                K.create('textarea[name="content"]', {
                    filterMode : false
                });
            });
</code>
Copy after login

However, this does not replace back-end filtering as the front-end processing can be bypassed.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template