From 0397e7ea64c208c140d7178ed34c3bd4b266fcfb Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Wed, 26 Jun 2013 17:52:40 +0200 Subject: [PATCH] Bug 9113: fix handling of certain characters by item batch modification tool If you're using the batch modification tool and entering a call number like "E+ 123 ABC", the tool removes the + and puts a space in its place, e.g., "E 123 ABC" This is because the form is posted via Ajax by background-job-progressbar.js. Values are URI-encoded using escape(), but this method does not escape some characters: * @ - _ + . / Also, "+" is considered as a space in a URI. This patch replaces escape() by encodeURIComponent() which encodes every character. Test plan : Perform an items batch modification by setting '* @ - _ + . /' in a field (notes for example) and see that all characters are saved correctly. Signed-off-by: Chris Cormack Signed-off-by: Kyle M Hall Signed-off-by: Galen Charlton --- .../intranet-tmpl/prog/en/js/background-job-progressbar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/background-job-progressbar.js b/koha-tmpl/intranet-tmpl/prog/en/js/background-job-progressbar.js index 2804182969..f8640c970a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/background-job-progressbar.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/background-job-progressbar.js @@ -45,12 +45,12 @@ function submitBackgroundJob(f) { $(':input', f).each(function() { if (this.type == 'radio' || this.type == 'checkbox') { if (this.checked) { - inputs.push(this.name + '=' + escape(this.value)); + inputs.push(this.name + '=' + encodeURIComponent(this.value)); } } else if (this.type == 'button') { ; // do nothing } else { - inputs.push(this.name + '=' + escape(this.value)); + inputs.push(this.name + '=' + encodeURIComponent(this.value)); } }); -- 2.39.5