LP1081576 - fix utf8 characters in searches using portal page
authorBen Shum <bshum@biblio.org>
Thu, 23 May 2013 20:32:49 +0000 (16:32 -0400)
committerBen Shum <bshum@biblio.org>
Fri, 31 May 2013 16:36:12 +0000 (12:36 -0400)
Replace escape() with encodeURIComponent() on the portal page to allow utf8
characters to be passed more appropriately to the subsequent search in catalog.

Thanks Dan Scott for pointing this out.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>
Open-ILS/xul/staff_client/server/index.xhtml

index fafe2a1..dabaa56 100644 (file)
@@ -41,9 +41,9 @@
         var search_depth = 0; // 0 = consortium, 1 = system, 2 = library, 3 = sub-library, etc.
         
         if(textbox && textbox.value != "") {
-                var opac_url =  xulG.url_prefix('opac_rresult') + "?rt=keyword&tp=keyword&l=" + home_ou_id + "&d=" + search_depth +"&f=&t=" + escape(textbox.value);
+                var opac_url =  xulG.url_prefix('opac_rresult') + "?rt=keyword&tp=keyword&l=" + home_ou_id + "&d=" + search_depth +"&f=&t=" + encodeURIComponent(textbox.value);
                 if (urls.opac_rresult.match(/\/eg\/opac\/results/)) {
-                    opac_url =  xulG.url_prefix('opac_rresult') + "?query=" + escape(textbox.value);
+                    opac_url =  xulG.url_prefix('opac_rresult') + "?query=" + encodeURIComponent(textbox.value);
                 }
                 var params = {'tab_name':'Catalog'};
                 var content_params = { 'session' : ses(), 'authtime' : ses('authtime'), 'opac_url' : opac_url };