aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cgi/modapi.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/cgi/modapi.py b/cgi/modapi.py
index 6350b35..c6fca39 100644
--- a/cgi/modapi.py
+++ b/cgi/modapi.py
@@ -81,12 +81,27 @@ def api_process(self, path_split):
id = formdata.get('id')
post = FetchOne("SELECT `id`, `boardid`, `parentid`,`timestamp`, `name`, `tripcode`, `email` ,`subject`,`message`,`file`,`thumb`, INET6_NTOA(`ip`) as ip,`IS_DELETED` AS `deleted`, `bumped`, `last`, `locked` FROM `posts` WHERE `id` = '" +
_mysql.escape_string(id) + "' AND `boardid` = '" + _mysql.escape_string(board["id"]) + "'")
+ post['id'] = int(post['id'])
+ post['bumped'] = int(post['bumped'])
+ post['deleted'] = int(post['deleted'])
+ post['last'] = int(post['last'])
+ post['locked'] = int(post['locked'])
+ post['parentid'] = int(post['parentid'])
+ post['timestamp'] = int(post['timestamp'])
values['post'] = post
if 'parentid' in formdata.keys():
id = formdata.get('parentid')
- post = FetchAll("SELECT `id`, `boardid`, `parentid`,`timestamp`, `name`, `tripcode`, `email` ,`subject`,`message`,`file`,`thumb`, INET6_NTOA(`ip`) as ip,`IS_DELETED` AS `deleted`, `bumped`, `last`, `locked` FROM `posts` WHERE `parentid` = '" +
- _mysql.escape_string(id) + "' AND `boardid` = '" + _mysql.escape_string(board["id"]) + "'")
- values['posts'] = post
+ posts = FetchAll("SELECT `id`, `boardid`, `parentid`,`timestamp`, `name`, `tripcode`, `email` ,`subject`,`message`,`file`,`thumb`, INET6_NTOA(`ip`) as ip,`IS_DELETED` AS `deleted`, `bumped`, `last`, `locked` FROM `posts` WHERE `parentid` = '" +
+ _mysql.escape_string(id) + "' AND `boardid` = '" + _mysql.escape_string(board["id"]) + "'")
+ for post in posts:
+ post['id'] = int(post['id'])
+ post['bumped'] = int(post['bumped'])
+ post['deleted'] = int(post['deleted'])
+ post['last'] = int(post['last'])
+ post['locked'] = int(post['locked'])
+ post['parentid'] = int(post['parentid'])
+ post['timestamp'] = int(post['timestamp'])
+ values['posts'] = posts
elif method == 'reports':
if len(path_split) > 3:
if path_split[3] == 'ignore':