www/prod_torecipe.php

changeset 305
bb55e065888a
parent 304
c0ca21cdd291
equal deleted inserted replaced
304:c0ca21cdd291 305:bb55e065888a
8 } 8 }
9 if (! mysqli_set_charset($link, "utf8" )) { 9 if (! mysqli_set_charset($link, "utf8" )) {
10 echo "error"; 10 echo "error";
11 return 1; 11 return 1;
12 } 12 }
13
14 $rescapers = array("'");
15 $rreplacements = array("\\'");
13 16
14 date_default_timezone_set('Europe/Amsterdam'); 17 date_default_timezone_set('Europe/Amsterdam');
15 if (isset($_GET["record"])) 18 if (isset($_GET["record"]))
16 $record = $_GET["record"]; 19 $record = $_GET["record"];
17 else 20 else
89 $sql .= "', w2_ph='" . $row['w2_ph']; 92 $sql .= "', w2_ph='" . $row['w2_ph'];
90 $sql .= "', w2_cost='" . $row['w2_cost']; 93 $sql .= "', w2_cost='" . $row['w2_cost'];
91 $sql .= "', wa_acid_name='" . $row['wa_acid_name']; 94 $sql .= "', wa_acid_name='" . $row['wa_acid_name'];
92 $sql .= "', wa_acid_perc='" . $row['wa_acid_perc']; 95 $sql .= "', wa_acid_perc='" . $row['wa_acid_perc'];
93 $sql .= "', wa_base_name='" . $row['wa_base_name']; 96 $sql .= "', wa_base_name='" . $row['wa_base_name'];
94 $sql .= "', json_fermentables='" . $row['json_fermentables']; 97 $sql .= "', json_fermentables='" . str_replace($rescapers,$rreplacements,$row['json_fermentables']);
95 $sql .= "', json_hops='" . $row['json_hops']; 98 $sql .= "', json_hops='" . str_replace($rescapers,$rreplacements,$row['json_hops']);
96 $sql .= "', json_miscs='" . $row['json_miscs']; 99 $sql .= "', json_miscs='" . str_replace($rescapers,$rreplacements,$row['json_miscs']);
97 $sql .= "', json_yeasts='" . $row['json_yeasts']; 100 $sql .= "', json_yeasts='" . str_replace($rescapers,$rreplacements,$row['json_yeasts']);
98 $sql .= "', json_mashs='" . $row['json_mashs']; 101 $sql .= "', json_mashs='" . str_replace($rescapers,$rreplacements,$row['json_mashs']);
99 $sql .= "';"; 102 $sql .= "';";
100 syslog(LOG_NOTICE, $sql); 103 syslog(LOG_NOTICE, $sql);
101 104
102 $result = mysqli_query($link, $sql); 105 $result = mysqli_query($link, $sql);
103 if (! $result) { 106 if (! $result) {

mercurial