Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Jemplate CPAN distribution.

Report information
The Basics
Id: 36420
Status: resolved
Priority: 0/
Queue: Jemplate

People
Owner: Nobody in particular
Requestors: LEEDO [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.22
Fixed in: (no value)



Subject: url filter not implemented
Currently there is only a 'uri' filter implemented in Jemplate. This filter actually appears to be implementing the TT 'url' filter. According to the Mozilla[1] documentation 'encodeURI' ignores these characters: ; , / ? : @ & = + $ The TT 'uri' filter is not supposed to ignore these characters, however, the 'url' filter is[2]. I have added a patch to duplicate the 'uri' behavior in 'url'. I have also begun a patch to correctly implement the 'uri' filter in Jemplate. 1: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Functions:encodeURI 2: http://template-toolkit.org/docs/manual/Filters.html#section_url
Subject: jemplate-url.patch
diff -r Jemplate-0.22/lib/Jemplate/Runtime.pm Jemplate-0.22-url/lib/Jemplate/Runtime.pm 261a262,265 > proto.filters.url = function(text) { > return encodeURI(text); > } >
I quickly discovered that encodeURIComponent does exactly what is needed for the 'uri' filter, and it appears to be supported in all modern browsers. Here is an updated patch that uses encodeURIComponent for the 'uri' filter, and encodeURI for the 'url' filter.
diff -r Jemplate-0.22/lib/Jemplate/Runtime.pm Jemplate-0.22-url/lib/Jemplate/Runtime.pm 258a259,262 > return encodeURIComponent(text); > } > > proto.filters.url = function(text) {
On Tue Jun 03 21:39:39 2008, LEEDO wrote: Show quoted text
> I quickly discovered that encodeURIComponent does exactly what is needed > for the 'uri' filter, and it appears to be supported in all modern
browsers. Show quoted text
> > Here is an updated patch that uses encodeURIComponent for the 'uri' > filter, and encodeURI for the 'url' filter.
Thanks, the repository has been patched and this fix will go out in the next version.