mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
Allow domains/groups/adlists to be removed from the database
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
+1
-2
@@ -243,11 +243,10 @@ static int api_list_write(struct mg_connection *conn,
|
||||
get_bool_var(payload, "enabled", &row.enabled);
|
||||
|
||||
char comment[256] = { 0 };
|
||||
GET_VAR("comment", comment, payload);
|
||||
if(GET_VAR("comment", comment, payload) > 0)
|
||||
row.comment = comment;
|
||||
else
|
||||
row.description = NULL;
|
||||
row.comment = NULL;
|
||||
|
||||
char description[256] = { 0 };
|
||||
if(GET_VAR("description", description, payload) > 0)
|
||||
|
||||
@@ -1531,7 +1531,7 @@ bool gravityDB_addToTable(const enum gravity_list_type listtype, const tablerow
|
||||
bool okay = false;
|
||||
if((rc = sqlite3_step(stmt)) == SQLITE_DONE)
|
||||
{
|
||||
// Domain added
|
||||
// Domain added/modified
|
||||
okay = true;
|
||||
}
|
||||
else
|
||||
@@ -1604,7 +1604,7 @@ bool gravityDB_delFromTable(const enum gravity_list_type listtype, const char* a
|
||||
}
|
||||
|
||||
// Bind domain to prepared statement (if requested)
|
||||
int idx = sqlite3_bind_parameter_index(stmt, "argument");
|
||||
int idx = sqlite3_bind_parameter_index(stmt, ":argument");
|
||||
if(idx > 0 && (rc = sqlite3_bind_text(stmt, idx, argument, -1, SQLITE_STATIC)) != SQLITE_OK)
|
||||
{
|
||||
*message = sqlite3_errmsg(gravity_db);
|
||||
@@ -1616,7 +1616,7 @@ bool gravityDB_delFromTable(const enum gravity_list_type listtype, const char* a
|
||||
}
|
||||
|
||||
// Bind type to prepared statement (if requested)
|
||||
idx = sqlite3_bind_parameter_index(stmt, "type");
|
||||
idx = sqlite3_bind_parameter_index(stmt, ":type");
|
||||
if(idx > 0 && (rc = sqlite3_bind_int(stmt, idx, type)) != SQLITE_OK)
|
||||
{
|
||||
*message = sqlite3_errmsg(gravity_db);
|
||||
|
||||
Reference in New Issue
Block a user