FSN#37309 Meer JSON.parse in plaats van eval

svn path=/Website/branches/v2016.1/; revision=30171
This commit is contained in:
Jos Groot Lipman
2016-07-27 15:23:17 +00:00
parent 91f03fae6a
commit 09ed988beb
6 changed files with 8 additions and 8 deletions

View File

@@ -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;

View File

@@ -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 = "";
}

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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;