diff options
Diffstat (limited to 'cgi/weabot.py')
-rwxr-xr-x | cgi/weabot.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/cgi/weabot.py b/cgi/weabot.py index eba4c72..8a9f82e 100755 --- a/cgi/weabot.py +++ b/cgi/weabot.py @@ -160,7 +160,7 @@ class weabot(object): # call post function (post_url, ttaken, unused) = self.make_post(ip, boarddir, parent, trap1, trap2, name, - email, subject, message, file, file_original, spoil, oek_file, password, noimage, mobile) + email, subject, message, file, file_original, spoil, oek_file, password, noimage, mobile) # make redirect self.output += make_redirect(post_url, ttaken) @@ -266,8 +266,7 @@ class weabot(object): if len(path_split) > 4 and path_split[4] and board['board_type'] == '1': # try: - self.output = dynamicRead( - int(path_split[3]), path_split[4], True) + self.output = dynamicRead(int(path_split[3]), path_split[4], True) # except: # self.output = threadPage(path_split[3], True) elif board['board_type'] == '1': @@ -313,10 +312,8 @@ class weabot(object): elif path_split[1] == "random": caught = True OpenDb() - board = FetchOne( - "SELECT `id`, `dir`, `board_type` FROM `boards` WHERE `secret` = 0 AND `id` <> 1 AND `id` <> 13 AND `id` <> 34 ORDER BY RAND() LIMIT 1") - thread = FetchOne( - "SELECT `id`, `timestamp` FROM `posts` WHERE `parentid` = 0 AND `boardid` = %s ORDER BY RAND() LIMIT 1" % board['id']) + board = FetchOne("SELECT `id`, `dir`, `board_type` FROM `boards` WHERE `secret` = 0 AND `id` <> 1 AND `id` <> 13 AND `id` <> 34 ORDER BY RAND() LIMIT 1") + thread = FetchOne("SELECT `id`, `timestamp` FROM `posts` WHERE `parentid` = 0 AND `boardid` = %s ORDER BY RAND() LIMIT 1" % board['id']) if board['board_type'] == '1': url = Settings.HOME_URL + \ board['dir'] + '/read/' + thread['timestamp'] + '/' @@ -380,8 +377,7 @@ class weabot(object): if addressIsBanned(self.environ['REMOTE_ADDR'], board["dir"], blind_only=True): raise UserError, '<meta http-equiv="refresh" content="0; url=/cgi/banned/%s">' % board["dir"] - self.output = dynamicRead( - int(path_split[3]), path_split[4]) + self.output = dynamicRead(int(path_split[3]), path_split[4]) elif path_split[1] == "preview": caught = True OpenDb() @@ -397,7 +393,7 @@ class weabot(object): import modapi caught = True self.headers = [("Content-Type", "application/json"), ("Access-Control-Allow-Origin", "*"), ("Access-Control-Allow-Methods", - "PUT, GET, POST, DELETE, OPTIONS"), ("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With")] + "PUT, GET, POST, DELETE, OPTIONS"), ("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With")] OpenDb() modapi.api(self, path_split) if not caught: @@ -602,7 +598,7 @@ class weabot(object): # make ID hash if board["useid"] != '0': post["timestamp_formatted"] += ' ID:' + iphash(ip, post, tim, board["useid"], mobile, - self.environ["HTTP_USER_AGENT"], cap_id, hide_end, (board["countrycode"] in ['1', '2'])) + self.environ["HTTP_USER_AGENT"], cap_id, hide_end, (board["countrycode"] in ['1', '2'])) # use for future file checks xfile = (file or oek_file) |