From 0f72ed03ebed2ea5e7c3287b4fe6ab78e649977d Mon Sep 17 00:00:00 2001 From: yillkid Date: Sat, 11 Jun 2016 10:54:16 +0800 Subject: [PATCH] Prevent escape html tag when create a new posts --- src/models/post.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/models/post.c b/src/models/post.c index 49a0ddf..7d8cd48 100644 --- a/src/models/post.c +++ b/src/models/post.c @@ -30,11 +30,9 @@ Post *postCreate(sqlite3 *DB, int authorId, char *body) if (rc != SQLITE_OK) return NULL; - char *escapedBody = bsEscape(body); - if (sqlite3_bind_int(statement, 1, t) != SQLITE_OK) goto fail; if (sqlite3_bind_int(statement, 2, authorId) != SQLITE_OK) goto fail; - if (sqlite3_bind_text(statement, 3, escapedBody, -1, NULL) != SQLITE_OK) + if (sqlite3_bind_text(statement, 3, body, -1, NULL) != SQLITE_OK) goto fail; if (sqlite3_step(statement) == SQLITE_DONE) @@ -42,7 +40,6 @@ Post *postCreate(sqlite3 *DB, int authorId, char *body) t, authorId, body); fail: - bsDel(escapedBody); sqlite3_finalize(statement); return post; }