Re: bug in HTML::Element ?

Walter Ian Kaye (walter@natural-innovations.com)
Fri, 3 Jul 1998 11:06:57 -0700 (PDT)


Kingpin> This is bad, of course the value of the HREF should not be changed!

RS>That's no bug.  That's proper HTML-encoding.

Kingpin> use HTML::Element;
Kingpin> my $a = new HTML::Element('a','href'=>'http://ouch.com/cgi-bin/program?a=a&b=b&c=c');
Kingpin> print $a->as_HTML;
Kingpin> =====
Kingpin> The result is:
Kingpin> <A HREF="http://ouch.com/cgi-bin/program?a=a&amp;b=b&amp;c=c"></A>

RS>Exactly as I would expect.  Otherwise, how would you get <, &, >, or "
RS>inside a quoted argument?

True. Of course, 'program' (or whatever parsing library it uses) should be
upgraded to accept ';' as well as '&' for the delimiter, and then the URL
could be 'http://ouch.com/cgi-bin/program?a=a;b=b;c=c', which eliminates
the problem entirely. (It's not my idea, it's from RFC 1866...;)


-Walter
 who wonders how to get the message out to all the 'program' authors...