Skip Menu |

This queue is for tickets about the HTML-CGIChecker CPAN distribution.

Report information
The Basics
Id: 50108
Status: new
Priority: 0/
Queue: HTML-CGIChecker

People
Owner: Nobody in particular
Requestors: DetlefPilzecker [...] web.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: HTML::CGIChecker - Nonsensically ampersand in HTML unicode is escaped
Date: Tue, 29 Sep 2009 22:20:01 +0200
To: <bug-HTML-CGIChecker [...] rt.cpan.org>
From: "Detlef Pilzecker" <DetlefPilzecker [...] web.de>
Hi, I am refering to: Tomas Styblo > HTML-CGIChecker-0.90 > HTML::CGIChecker In the last sub: ---------------------------------------------------------- # Escapes some dangerous characters. # Ampersand "&" is escaped only if it is not part of a HTML entity. # Therefore, users can post HTML entities. Ampersands that are part # of an ordinary text are still properly escaped. # Thanks to godless@hermes.slipstream.com for this idea. sub _html_escape { my $self = shift; my ($in) = @_; for ($in) { s/&(?!\w+;)/&amp;/g; s/>/&gt;/g; s/</&lt;/g; s/"/&quot;/g; } return $in; } ---------------------------------------------------------- I found a bug: The ampersand "&" is also escaped if it is part of a HTML unicode ( &#xxxx; ) To fix this replace s/&(?!\w+;)/&amp;/g; with s/&(?![#\w]+;)/&amp;/g; Regards Detlef Pilzecker Weitlahnerstaße 8 83209 Prien am Chiemsee