[Templates] Bug report against Template::Plugin::URL

Randal L. Schwartz merlyn@stonehenge.com
22 Dec 2005 18:03:35 -0800


This is wrong:

    [% USE url('/foo/bar'); url(this = 'that' fred = 'flintstone') %]

    ==>

    /foo/bar?fred=flintstone&this=that

Because I can't do this then:

  [% USE url('/foo/bar'); link = url(this = 'that' fred = 'flintstone') %]
  [% USE CGI; CGI.a({href = link}, 'link text') %]

  ==>

  <a href="/foo/bar?fred=flintstone&amp;amp;this=that">link text</a>

Notice the double escaping of &amp.  Bad, bad.  The URL plugin
should be returning the real URL, not an HTML escaped URL.

Just have url return the unescaped thing, and let the user push
it through "FILTER html" if they need.  For example, to hand-construct
that link, I could say:

  <a href="[% link | html %]">link text</a>

Oddly, I thought we had resolved this about two years ago.  Maybe
some old version crept in.

Anyway, Template::Plugin::URL is useless (and therefore broken) at the
moment.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!