REPLACE quoting for VALUES in CQnetDB::Update

pull/14/head
Tom Early 6 years ago
parent 4a35a2531d
commit f85864b11c

@ -51,17 +51,17 @@ bool CQnetDB::Update(const char *mycall, const char *sfx, const char *urcall, co
{ {
if (NULL == db) if (NULL == db)
return false; return false;
std::string sql = "REPLACE INTO LHEARD (mycall,sfx,urcall,module,gateway,lasttime) VALUES ("; std::string sql = "REPLACE INTO LHEARD (mycall,sfx,urcall,module,gateway,lasttime) VALUES ('";
sql.append(mycall); sql.append(mycall);
sql.append("\",\""); sql.append("','");
sql.append(sfx); sql.append(sfx);
sql.append("\",\""); sql.append("','");
sql.append(urcall); sql.append(urcall);
sql.append("\",\""); sql.append("','");
sql.append(module); sql.append(module);
sql.append("\",\""); sql.append("','");
sql.append(gateway); sql.append(gateway);
sql.append("\","); sql.append("',");
sql.append("strftime('%s','now'));"); sql.append("strftime('%s','now'));");
char *eMsg; char *eMsg;

@ -31,6 +31,7 @@
function GetCFGValue(string $key) function GetCFGValue(string $key)
{ {
global $cfg, $defaults;
if (array_key_exists($key, $cfg)) if (array_key_exists($key, $cfg))
return $cfg[$key]; return $cfg[$key];
if ('module_' == substr($key, 0, 7)) { if ('module_' == substr($key, 0, 7)) {

Loading…
Cancel
Save

Powered by TurnKey Linux.