From 7550be09216807b7bacd036327f44726f148272c Mon Sep 17 00:00:00 2001 From: s1341 Date: Tue, 19 Nov 2013 18:16:59 +0200 Subject: [PATCH] strip off trailing commas --- src/static/js/admin/settings.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/static/js/admin/settings.js b/src/static/js/admin/settings.js index ebe4a25a..fb3f2e97 100644 --- a/src/static/js/admin/settings.js +++ b/src/static/js/admin/settings.js @@ -55,6 +55,8 @@ $(document).ready(function () { function isJSONClean(data){ var cleanSettings = JSON.minify(data); + // this is a bit naive. In theory some key/value might contain the sequences ',]' or ',}' + cleanSettings = cleanSettings.replace(",]","]").replace(",}","}"); try{ var response = jQuery.parseJSON(cleanSettings); }