* Marcin Kasperski <[EMAIL PROTECTED]> [2002-11-08 16:22]: > I use Apache::Util::escape_html to perform fast HTML-escaping of the > data before displaying it. Unfortunately, this function handles > <, >, & and " but does not handle ' (single quote) - which > can be escaped as '
Hey, this is an easy one. Apply the attached patch to mod_perl-1.XX/src/modules/perl/Util.xs, and single quotes will be turned into ' (darren) -- If history teaches us anything, it's that everyone will be part of the problem, but not everyone will be part of the solution. -- Larry Wall
--- Util.xs.orig Fri Nov 8 16:42:42 2002 +++ Util.xs Fri Nov 8 16:44:49 2002 @@ -67,6 +67,10 @@ static SV *my_escape_html(char *s) memcpy(&SvPVX(x)[j], """, 6); j += 5; } + else if (s[i] == '\'') { + memcpy(&SvPVX(x)[j], "'", 6); + j += 5; + } else SvPVX(x)[j] = s[i];