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  :-\

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.