Want to 'sandbox' user form submitted HTML
Posted
by pmmenneg
on Stack Overflow
See other posts from Stack Overflow
or by pmmenneg
Published on 2010-06-03T18:28:37Z
Indexed on
2010/06/03
18:34 UTC
Read the original article
Hit count: 147
Hi all. I have a user form with a textarea that allows users to submit html formatted data. The html itself is limited by PHP strip_tags, but of course that does no completion checking etc.
My basic problem is that should a user leave a tag unclosed, such as the tag, then all the content following that, including page content that follows that is 'outside' the user content display area, could now be malformed.
Checking for proper tag completion is one solution I will look at, but ideally I'd like to firewall the user htmlified content away from the rest of the site somehow.
Any suggestions on the best approach?
Thanks!
© Stack Overflow or respective owner