I was wondering how I would do the following. I use the tiny MCE wysiwyg editor, which formats user data with the correct html tags. Now I need to save this data entered into the editor into the database table.
Should I encode html tags to their corresponding objects when pasting into the database, then when I return the data from the table, I don’t need to encode it for XSS purposes, but I still have to use eval for html tags to format the text.
OR
I can save the html tags in the database, and then, when I return the data from the database, encode the html tags to my objects, but when the tags appear to the user, I will have to use eval to actually format the data as it is input.
My thoughts are with the first option, I just thought about what you guys thought.
source share