42

I'm using TinyMce and even though the danger of a script attack, I need to enable all html tags with the editor.

Currently, I'm use like:

valid_elements: "@[class],p[style],h3,h4,h5,h6,a[href|target],strong/b,"
              + "div[align],br,table,tbody,thead,tr,td,ul,ol,li,img[src]"

But always need to add something, I want to enable ALL HTML tags with all attributes. Is there such switch that Disables the HTML filtering?

Thariama
  • 50,002
  • 13
  • 138
  • 166
E-A
  • 1,995
  • 6
  • 33
  • 47
  • 1
    This is a security nightmare waiting to happen... this means you will allow arbitrary HTML code into your program. This is an XSS dream! – avgvstvs Oct 21 '15 at 17:12
  • In my case I'm using tinyMCE on a JxBrowser instance in a desktop application, which shouldn't be affected by XSS. I do understand the risk implied, but it would be nice if there was an option to allow all tags (even ) as input if you're *really really* sure. – Roger Apr 05 '17 at 14:33
  • this solution also works in modx with TinyMCE Rich Text Editor. just put the ``*[*]`` in valid elements field in the mce system settings. Put this in accepted answer as a comment please, my points are not enough. – Gevorg Hakobyan Jul 23 '17 at 22:09

2 Answers2

75

You can set

valid_elements : '*[*]',

to allow all html tags.

Thariama
  • 50,002
  • 13
  • 138
  • 166
4

To keep style tags, use valid_children : "+body[style]"