Mat Schaffer
7/23/2006 6:33:00 PM
On Jul 23, 2006, at 12:17 PM, Max Benjamin wrote:
> Thanks for the quick replys.
> I should have been more explicit in my question. I want to strip html
> tags in order to sanitize form input. I'm a bit of a ruby noob and I
> was hoping to find a function similar to PHP's strip_tags, one that
> would remove both html and ruby code.
> Best
For sanitizing input, just escaping might be a better idea because it
has less chance of being destructive. If you're on rails there's an h
() function for this. If you're doing something else, maybe check
out how rails does it and replicate it. There might be something
easy that someone on this list knows that don't.
If you really want to strip them, I'd bet the regexp solution is no
less effective than PHP's strip_tags.
-Mat