Welcome Guest, Not a member yet? Register   Sign In
Sanitizing user input for blog commenting
#1

[eluser]mikegioia[/eluser]
Hi guys -

I'm in the process of writing a script to handle user comments for a blog. Right now I'm stripping out unwanted tags and running the comment through CI's XSS filter and then the typography helper to format it nice.

The problem I'm having is that unclosed tags like '<em>Text</e>' are breaking in the page. I'd like the script to render that as text and not as code instead of trying to output the code and having it break.

Another problem is that I'm stripping out unwanted tags like '<div>'. I'd like it to just display the text '<div>' instead of stripping that text out completely.

Are there any libraries anyone's used that can do this for me? I've looked around and I can't find anything.

Thanks for any of your help,
Mike


Messages In This Thread
Sanitizing user input for blog commenting - by El Forum - 05-27-2008, 06:10 PM
Sanitizing user input for blog commenting - by El Forum - 05-27-2008, 08:10 PM
Sanitizing user input for blog commenting - by El Forum - 05-27-2008, 08:20 PM
Sanitizing user input for blog commenting - by El Forum - 05-28-2008, 11:03 AM
Sanitizing user input for blog commenting - by El Forum - 05-28-2008, 11:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB