[Templates] Problem with URL ecoded vars? Upgraded from Template-Toolkit
v 2.11 to 2.19
Dave Cross
dave@dave.org.uk
Sat, 15 Sep 2007 22:48:44 +0100
David Martin wrote:
> Hello,
>
> My first post to the list in maybe 3 years. Back in 2003-4 my partner and I
> built a midsize educational framework Class::DBI and Template-Toolkit (v
> 2.11 then, 2.19 now) project for the U.S. Dept. of Education. It worked
> fine for 4 years until the host folded up shop.
>
> I got it back live today on a new host and now that all the modules were in
> place it seems to work just fine except for one problem. Some templates
> need to embed Flash animations and the URLs are now url-encoded like
> %2Fcourses%2Fwetlands%2Fm%2Fi0101.swf.
[ snip ]
> Could this be a TT version issue? Any advice where to look?
You should take a look at the Changes file. In particular the changes
for version 2.15b include:
* Changed the uri filter to escape all reserved characters as per
URI::Escape and RFC2396. This now includes &, @, /, ;, :, =, +, ?
and $ which were previously not escaped. Thanks to islue@cpan.org
for reporting the problem.
http://rt.cpan.org/Ticket/Display.html?id=19593
However, the changes for version 2.19 include:
* Added the url filter as a less aggressive form of the uri filter.
Whereas the uri filter now (from v2.16 onwards) encodes all the
reserved characters (@, :, /, etc.) as per RFC2396, the url filter
leaves them intact and thus behaves just like the uri filter used
to.
http://tt2.org/pipermail/templates/2007-March/009277.html
So you fix might well be as simple as switching from the uri filter to
the url filter.
Dave...