mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-26 12:51:52 +02:00
make parsing of arguments more robust
This commit is contained in:
parent
b692346cce
commit
d3f2b0a1f9
@ -69,7 +69,12 @@ egw_LAB.wait(function() {
|
|||||||
var args = [];
|
var args = [];
|
||||||
if (matches.length > 1 && matches[2] !== undefined)
|
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]);
|
args.unshift(matches[1]);
|
||||||
return et2_call.apply(this, args);
|
return et2_call.apply(this, args);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user