From d3f2b0a1f97d93d6dc7635bed9926f6d3517bbbb Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 19 Feb 2014 15:11:57 +0000 Subject: [PATCH] make parsing of arguments more robust --- phpgwapi/templates/idots/js/idots.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpgwapi/templates/idots/js/idots.js b/phpgwapi/templates/idots/js/idots.js index ee8c5d87b4..556872439d 100644 --- a/phpgwapi/templates/idots/js/idots.js +++ b/phpgwapi/templates/idots/js/idots.js @@ -69,7 +69,12 @@ egw_LAB.wait(function() { var args = []; if (matches.length > 1 && matches[2] !== undefined) { - args = JSON.parse('['+matches[2].replace(/'/g,'"')+']'); + try { + args = JSON.parse('['+matches[2]+']'); + } + catch(e) { // deal with '-encloded strings (JSON allows only ") + args = JSON.parse('['+matches[2].replace(/','/g, '","').replace(/((^|,)'|'(,|$))/g, '$2"$3')+']'); + } } args.unshift(matches[1]); return et2_call.apply(this, args);