From 09ed988beb250c7346b5861a32d48af739adfbfa Mon Sep 17 00:00:00 2001 From: Jos Groot Lipman Date: Wed, 27 Jul 2016 15:23:17 +0000 Subject: [PATCH] FSN#37309 Meer JSON.parse in plaats van eval svn path=/Website/branches/v2016.1/; revision=30171 --- APPL/FAC/fac_edit_api.asp | 2 +- APPL/FAC/fac_edit_api_save.asp | 4 ++-- APPL/FAC/fac_edit_template.asp | 2 +- APPL/FAC/fac_setting.asp | 4 ++-- APPL/FAC/fac_settings_list.asp | 2 +- APPL/FAC/fac_show_api.asp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/APPL/FAC/fac_edit_api.asp b/APPL/FAC/fac_edit_api.asp index cdb2aed182..19b203768b 100644 --- a/APPL/FAC/fac_edit_api.asp +++ b/APPL/FAC/fac_edit_api.asp @@ -37,7 +37,7 @@ function prettyJson(j) { try { - var xx = JSON.stringify(eval("(" + j + ")"), null, 2); + var xx = JSON.stringify(JSON.parse(j), null, 2); if (xx == "null") return ""; return xx; diff --git a/APPL/FAC/fac_edit_api_save.asp b/APPL/FAC/fac_edit_api_save.asp index 4350edfcd9..daea9c76de 100644 --- a/APPL/FAC/fac_edit_api_save.asp +++ b/APPL/FAC/fac_edit_api_save.asp @@ -28,7 +28,7 @@ if (viewoptions) { try { - viewoptions = JSON.stringify(eval("(" + viewoptions + ")")); // test en formatteer plat + viewoptions = JSON.stringify(JSON.parse(viewoptions)); // test en formatteer plat if (viewoptions == "null") viewoptions = ""; } @@ -42,7 +42,7 @@ if (viewjson) { try { - viewjson = JSON.stringify(eval("(" + viewjson + ")")); // test en formatteer plat + viewjson = JSON.stringify(JSON.parse(viewjson)); // test en formatteer plat if (viewjson == "null") viewjson = ""; } diff --git a/APPL/FAC/fac_edit_template.asp b/APPL/FAC/fac_edit_template.asp index 3f185a2557..e3c6f74058 100644 --- a/APPL/FAC/fac_edit_template.asp +++ b/APPL/FAC/fac_edit_template.asp @@ -24,7 +24,7 @@ function prettyJson(j) { try { - var xx = JSON.stringify(eval("(" + j + ")"), null, 2); + var xx = JSON.stringify(JSON.parse(j), null, 2); if (xx == "null") return ""; return xx; diff --git a/APPL/FAC/fac_setting.asp b/APPL/FAC/fac_setting.asp index a6507de646..546a22b79a 100644 --- a/APPL/FAC/fac_setting.asp +++ b/APPL/FAC/fac_setting.asp @@ -27,7 +27,7 @@ function prettyJson(j) { try { - var xx = JSON.stringify(eval("("+j + ")"), null, 2); + var xx = JSON.stringify(JSON.parse(j), null, 2); if (xx == "null") return ""; return xx; @@ -122,7 +122,7 @@ canChange = (!isProtected || { try { - vtype = JSON.stringify(eval("(" + vtype + ")")); // test en formatteer plat + vtype = JSON.stringify(JSON.parse(vtype)); // test en formatteer plat if (vtype == "null") vtype = ""; $("#pvalue").val(vtype); // zet de platte tekst terug in de database diff --git a/APPL/FAC/fac_settings_list.asp b/APPL/FAC/fac_settings_list.asp index c3a227ce20..e917505b90 100644 --- a/APPL/FAC/fac_settings_list.asp +++ b/APPL/FAC/fac_settings_list.asp @@ -73,7 +73,7 @@ function prettyJson(j) { try { - var xx = JSON.stringify(eval("("+j + ")"), null, 2); + var xx = JSON.stringify(JSON.parse(j), null, 2); if (xx == "null") return ""; return xx; diff --git a/APPL/FAC/fac_show_api.asp b/APPL/FAC/fac_show_api.asp index 7c652f337a..e46863874f 100644 --- a/APPL/FAC/fac_show_api.asp +++ b/APPL/FAC/fac_show_api.asp @@ -86,7 +86,7 @@ function prettyJson(j) { try { - var xx = JSON.stringify(eval("("+j + ")"), null, String.fromCharCode(160, 160, 160, 160)); + var xx = JSON.stringify(JSON.parse(j), null, String.fromCharCode(160, 160, 160, 160)); if (xx == "null") return ""; return xx;