Less aggressive URL encoding
authorDan Scott <dan@coffeecode.net>
Tue, 3 May 2011 21:08:59 +0000 (17:08 -0400)
committerDan Scott <dan@coffeecode.net>
Tue, 3 May 2011 21:08:59 +0000 (17:08 -0400)
We were double-encoding URIs, as the url and uri filters in
TT happily encode % - which is fine the first time around,
but after you've already escaped everything as %nn the propagator
was serving it back to url to be escaped again on the following
page request.

The right way to do this might be to unescape the incoming query
string, then pass it on to url for escaping again - but for now,
using the entity version of & is good enough to begin with.

Signed-off-by: Dan Scott <dan@coffeecode.net>

Open-ILS/web/templates/default/opac/parts/header.tt2

index 4c68368..114b4c3 100644 (file)
 
     query_string = CGI.query_string |
         replace(';x=\d+','') | replace(';y=\d+','') | replace(';page=\d*', '') |
-        replace(';', '&');
+        replace(';', '&') | replace('&', '&amp;');
 
-
-    propagator = '?' _ query_string | url | replace('&', '&amp;');
+    propagator = '?' _ query_string;
 
     is_advanced = CGI.param("_adv").size;
 %]