开发者

CKEditor post Issue in Codeigniter, tags are trimmed

开发者 https://www.devze.com 2023-03-19 15:14 出处:网络
I\'m working on a project with CodeIgniter, on my localhost on latest version of wamp server on w7 enterprise x64 SP1 with google chrome 14.0.803.0 dev-m, and added 开发者_JAVA百科CKeditor 3.6.1 follo

I'm working on a project with CodeIgniter, on my localhost on latest version of wamp server on w7 enterprise x64 SP1 with google chrome 14.0.803.0 dev-m, and added 开发者_JAVA百科CKeditor 3.6.1 following this guide.

There's a weird issue I'm suffering with, hope you can help me.

When I post data, it's sort of "trimmed". I mean, before I submit the form, the content on the textarea when I press source code on ckeditor is this:

<p>
    <span style="font-size:16px;"><span style="font-family:comic sans ms,cursive;"><span style="background-color:#ffff00;">foobar</span></span></span></p>

But after the post, it becomes this (got the code using die("<pre>".print_r($_POST)."</pre>") at the very top of my posting method and viewing source code, same is added to database):

<p>

 <span>span style="font-family:comic sans ms,cursive;"><span>foobar</span></span></span></p>

Why <span> turns into <span>span ? How can I fix this ?

p.s: would you suggest TinyMCE instead of CKeditor ?

Thanks in advance.


Do you have XSS filter turned on in the config file? It removes some "illegal" tags from your POST input.

If yes, turn it off and try again. If your problem is fixed you now know where the problem lies. Now you only need to turn back on the XSS filter and find a way to bypass the XSS filter for the CKEditor field.

I used this method: http://codeigniter.com/forums/viewthread/186100/#919438

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号