aboutsummaryrefslogtreecommitdiff
path: root/cgi/post.py
diff options
context:
space:
mode:
Diffstat (limited to 'cgi/post.py')
-rw-r--r--cgi/post.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cgi/post.py b/cgi/post.py
index 22d8197..89c2a19 100644
--- a/cgi/post.py
+++ b/cgi/post.py
@@ -474,7 +474,7 @@ def catalog(sort=''):
thread['message'] = thread['message'].replace('<br />', ' ')
thread['message'] = thread['message'].split("<hr />")[0]
thread['message'] = re.compile(r"<[^>]*?>", re.DOTALL | re.IGNORECASE).sub('', thread['message'])
- thread['message'] = thread['message'].decode('utf-8')[:cutFactor].encode('utf-8')
+ thread['message'] = thread['message'][:cutFactor]
thread['message'] = re.compile(r"&(.(?!;))*$", re.DOTALL | re.IGNORECASE).sub('', thread['message']) # Removes incomplete HTML entities
return renderTemplate("catalog.html", {"threads": threads, "i_sort": sort})
@@ -543,7 +543,7 @@ def dynamicRead(parentid, ranges, mobile=False):
import json
with open(fname) as f:
thread = json.load(f)
- thread['posts'] = [dict(list(zip(thread['keys'], row))) for row in thread['posts']]
+ thread['posts'] = [dict(zip(thread['keys'], row)) for row in thread['posts']]
template_fname = "txt_archive.html"
else:
raise UserError('El hilo no existe.')
@@ -687,7 +687,7 @@ def regenerateBoard(everything=False):
for post in op_posts:
regenerateThreadPage(post["id"])
-def deletePost(postid, password, deltype='0', imageonly=False, quick=False):
+def deletePost(postid, password, deltype=0, imageonly=False, quick=False):
"""
Remove post from database and unlink file (if present), along with all replies
if supplied post is a thread