Re: bug in HTML::Element ?

Randal Schwartz (merlyn@stonehenge.com)
03 Jul 1998 09:18:43 -0700


>>>>> "Kingpin" == Kingpin  <mthurn@fandago.read.tasc.com> writes:

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

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>

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

I haven't seen a working browser that didn't know to un-HTML-ize this
encoding.  If you find a browser that can't do it, it's non-standard,
and needs to be reported as a bug.

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me