From f96507c0ed31c045f9c888b66825cb2c7d1d64f5 Mon Sep 17 00:00:00 2001 From: darknoon29 Date: Wed, 5 Feb 2020 13:54:36 +0100 Subject: [PATCH] Escape " in JSON Arrays --- install.php | 4 ++-- update.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install.php b/install.php index 15e313b..4f3bd23 100644 --- a/install.php +++ b/install.php @@ -46,11 +46,11 @@ $db->sql_query($query); // on insère les valeurs de configuration par défaut -$sqldata = '{"transp":75,"layer":1,"defenseur":1,"histo":1}'; +$sqldata = '{\"transp\":75,\"layer\":1,\"defenseur\":1,\"histo\":1}'; mod_set_option('config', $sqldata); // on insère les valeurs bbcodes par défaut -$sqldata = '{"title":"#FFA500","m_g":"#00FF40","c_g":"#00FF40","d_g":"#00FF40","m_r":"#00FF40","c_r":"#00FF40","perte":"#FF0000","renta":"#00FF40"}'; +$sqldata = '{\"title\":\"#FFA500\",\"m_g\":\"#00FF40\",\"c_g\":\"#00FF40\",\"d_g\":\"#00FF40\",\"m_r\":\"#00FF40\",\"c_r\":\"#00FF40\",\"perte\":\"#FF0000\",\"renta\":\"#00FF40\"}'; mod_set_option('bbcodes', $sqldata); //On vérifie que la table xtense_callbacks existe (Xtense2) diff --git a/update.php b/update.php index 68c463b..1c5e98e 100755 --- a/update.php +++ b/update.php @@ -34,11 +34,11 @@ if (version_compare( $version , '2.0.0.', '<')) { // on insère les valeurs de configuration par défaut car changement de format de données - $sqldata = '{"transp":75,"layer":1,"defenseur":1,"histo":1}'; + $sqldata = '{\"transp\":75,\"layer\":1,\"defenseur\":1,\"histo\":1}'; mod_set_option('config', $sqldata); // on insère les valeurs bbcodes par défaut - $sqldata = '{"title":"#FFA500","m_g":"#00FF40","c_g":"#00FF40","d_g":"#00FF40","m_r":"#00FF40","c_r":"#00FF40","perte":"#FF0000","renta":"#00FF40"}'; + $sqldata = '{\"title\":\"#FFA500\",\"m_g\":\"#00FF40\",\"c_g\":\"#00FF40\",\"d_g\":\"#00FF40\",\"m_r\":\"#00FF40\",\"c_r\":\"#00FF40\",\"perte\":\"#FF0000\",\"renta\":\"#00FF40\"}'; mod_set_option('bbcodes', $sqldata); }