If you have some variables which include '&' and want to pass the
variable to CGI query parameter, you'd use 'uri' filter.
[% file = 'foo & bar.txt'; %]
<a href="action?file=[% file | uri %]">link</a>
But, it doesn't work. Default uri filter doesn't escape '&', because
'&' is safe to be used in URI. So the output link gets broken.
<a href="action?file=foo%20&%20bar.txt">link</a>
You know '&' has a different meaning if you use it in CGI query
parameter, which is used as a parameter separator.
I avoid this by using custom filter named 'uri_full', which does
sub { use URI::Escape; uri_escape(shift, '\W') }
So why not adding this filter as 'uri_full' or something, to TT itself?
--
Tatsuhiko Miyagawa <[EMAIL PROTECTED]>
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.ourshack.com/mailman/listinfo/templates