this.user Posted September 8, 2010 Share Posted September 8, 2010 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 https://forums.phpfreaks.com/topic/212869-how-to-use-rich-text-editor-for-text-area-input-and-yet-prevent-injections/ Share on other sites More sharing options...
The Eagle Posted September 8, 2010 Share Posted September 8, 2010 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 https://forums.phpfreaks.com/topic/212869-how-to-use-rich-text-editor-for-text-area-input-and-yet-prevent-injections/#findComment-1108759 Share on other sites More sharing options...
this.user Posted September 9, 2010 Author Share Posted September 9, 2010 So how would I handle the input? lets say the value is stored in $_POST['comment'] Here is what I am worried about for example: </div></div> Link to comment https://forums.phpfreaks.com/topic/212869-how-to-use-rich-text-editor-for-text-area-input-and-yet-prevent-injections/#findComment-1109329 Share on other sites More sharing options...
fortnox007 Posted September 9, 2010 Share Posted September 9, 2010 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 https://forums.phpfreaks.com/topic/212869-how-to-use-rich-text-editor-for-text-area-input-and-yet-prevent-injections/#findComment-1109333 Share on other sites More sharing options...
this.user Posted September 9, 2010 Author Share Posted September 9, 2010 thanks, ill look into it some more. Link to comment https://forums.phpfreaks.com/topic/212869-how-to-use-rich-text-editor-for-text-area-input-and-yet-prevent-injections/#findComment-1109420 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.