From 8714b5090f110f2999c3c68b045dbf47a05539dd Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 5 Feb 2014 13:39:00 +0530 Subject: [PATCH] Encode URI component in link field formatter --- public/js/wn/form/formatters.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/js/wn/form/formatters.js b/public/js/wn/form/formatters.js index 398065afd2..1f75eef90c 100644 --- a/public/js/wn/form/formatters.js +++ b/public/js/wn/form/formatters.js @@ -35,9 +35,10 @@ wn.form.formatters = { if(!value) return ""; if(docfield && docfield.options) { - return repl('%(icon)s%(name)s', { - doctype: docfield.options, - name: value, + return repl('%(icon)s%(label)s', { + doctype: encodeURIComponent(docfield.options), + name: encodeURIComponent(value), + label: value, icon: (options && options.no_icon) ? "" : (' ') });