diff -r d4f4762e59b3 -r bb9a06aa9acd www/includes/db_recipes.php --- a/www/includes/db_recipes.php Tue Sep 18 23:16:14 2018 +0200 +++ b/www/includes/db_recipes.php Thu Sep 20 16:19:09 2018 +0200 @@ -14,6 +14,7 @@ $escapers = array("\\", "/", "\"", "\n", "\r", "\t", "\x08", "\x0c"); $replacements = array("\\\\", "\\/", "\\\"", "\\n", "\\r", "\\t", "\\f", "\\b"); +$disallowed = array('visibleindex','uniqueid','boundindex','uid'); // get data and store in a json array $query = "SELECT * FROM recipes ORDER BY st_guide,st_letter,st_name,name"; @@ -58,8 +59,23 @@ syslog(LOG_NOTICE, $sql); // Log upto this part. - syslog(LOG_NOTICE, "json_waters: " . json_encode($_GET['waters'])); - $sql .= "', json_waters='" . json_encode($_GET['waters']); + $array = $_GET['fermentables']; + foreach($array as $key => $item){ + foreach ($disallowed as $disallowed_key) { + unset($array[$key]["$disallowed_key"]); + } + } + syslog(LOG_NOTICE, "json_fermentables: " . json_encode($array)); + $sql .= "', json_fermentables='" . json_encode($array); + + $array = $_GET['waters']; + foreach($array as $key => $item){ + foreach ($disallowed as $disallowed_key) { + unset($array[$key]["$disallowed_key"]); + } + } + syslog(LOG_NOTICE, "json_waters: " . json_encode($array)); + $sql .= "', json_waters='" . json_encode($array); if (isset($_GET['insert'])) { $sql .= "';";