最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - TinyMCE strips inline style with valid-elements: *[*] with Codeigniter - Stack Overflow

programmeradmin1浏览0评论

I have read Tinymce strips attributes on submit, TinyMce Allow all Html tag, TinyMCE valid elements: only allow specific CSS rules, how to prevent tinymce from stripping the 'style' attribute from input element?, TinyMCE, allow data attribute and many others...

But none of them work.

This is my code:

valid_elements : '+*[*]',
cleanup: false,
inline_styles : true

I have also tried

valid_elements : '*[*]'

(without + before *[*])

and even

valid_children : '+body[style]'

But when I add the styles manually like style="color: #fff;" and submit the form, TinyMCE removes the returned output.

In other words: I want TinyMCE to stop 'removing' any code automatically.

I have read Tinymce strips attributes on submit, TinyMce Allow all Html tag, TinyMCE valid elements: only allow specific CSS rules, how to prevent tinymce from stripping the 'style' attribute from input element?, TinyMCE, allow data attribute and many others...

But none of them work.

This is my code:

valid_elements : '+*[*]',
cleanup: false,
inline_styles : true

I have also tried

valid_elements : '*[*]'

(without + before *[*])

and even

valid_children : '+body[style]'

But when I add the styles manually like style="color: #fff;" and submit the form, TinyMCE removes the returned output.

In other words: I want TinyMCE to stop 'removing' any code automatically.

Share Improve this question edited May 23, 2017 at 12:07 CommunityBot 11 silver badge asked Oct 20, 2012 at 20:26 Mohammad NajiMohammad Naji 5,44210 gold badges55 silver badges80 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 11

No, it was not TinyMCE that was preventing inline styles.

CodeIgniter did that.

Even now that I had manually disabled XSS filtering using:

$body = $this->input('body', FALSE);

, that was still being removed because I had enabled XSS filtering in application/config/config.php:

$config['global_xss_filtering'] = TRUE;

But when I changed it to

$config['global_xss_filtering'] = FALSE;

the problem was resolved and I got rid of the Server Side filtering.


I post the answer here and I hope no one else be such crazy and mad that I became!

发布评论

评论列表(0)

  1. 暂无评论