Jump to content

How to use rich text editor for text-area input and yet prevent injections?


this.user

Recommended Posts

I'd like to use a text editor like this one: http://tinymce.moxiecode.com/examples/full.php for my forums.

 

 

But I am not sure exactly how I would prevent abuse and injects to messed up the page, rather than being contained in  the designated area it is meant for.

 

 

Could some  one please help me, I know htmlspecailchars will not work, since some of the code needs to render as html  :-\

Well, a fully written WYSIWYG editor most likely doesn't have many injection vulnerabilities, as it's used widely and I've not heard of a complaint nor had one myself.

 

If you'd write your own, which I must say would be extremely difficult, you'd probably have more chances of injections than using a premade one.

Well as stated if you use a text-editor, it will strip out the stuff you don't want in it. I am pretty sure every editors has it's own ways of doing it, but I am also pretty sure you can just put the input right in the database. I recommend reading the documentation of the specific editor since this would be a wild guess

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.