Some fixes (#300)

* Narrow emoji_regex

* Fix mirrored pat emojis

* Fix ban icon on posts/comments
remotes/1693045480750635534/spooky-22
float-trip 2022-06-02 19:18:10 -04:00 committed by GitHub
parent c839dd5103
commit 58c4b62163
3 changed files with 6 additions and 6 deletions

View File

@ -873,7 +873,7 @@ strikethrough_regex = re.compile('''~{1,2}([^~]+)~{1,2}''', flags=re.A)
mute_regex = re.compile("/mute @([a-z0-9_\-]{3,25}) ([0-9])+", flags=re.A)
emoji_regex = re.compile(f"[^a]>\s*(:[!#@]{{0,3}}[{valid_username_chars}]+:\s*)+<\/", flags=re.A)
emoji_regex = re.compile(f"<p>\s*(:[!#@]{{0,3}}[{valid_username_chars}]+:\s*)+<\/p>", flags=re.A)
emoji_regex2 = re.compile(f"(?<!\"):([!#@{valid_username_chars}]{{1,31}}?):", flags=re.A)
emoji_regex3 = re.compile(f"(?<!\"):([!@{valid_username_chars}]{{1,31}}?):", flags=re.A)

View File

@ -1158,16 +1158,16 @@ def ban_user(user_id, v):
g.db.add(ma)
if 'reason' in request.values:
if reason.startswith("/post/"):
if request.values["reason"].startswith("/post/"):
try:
post = int(reason.split("/post/")[1].split(None, 1)[0])
post = int(request.values["reason"].split("/post/")[1].split(None, 1)[0])
post = get_post(post)
post.bannedfor = True
g.db.add(post)
except: pass
elif reason.startswith("/comment/"):
elif request.values["reason"].startswith("/comment/"):
try:
comment = int(reason.split("/comment/")[1].split(None, 1)[0])
comment = int(request.values["reason"].split("/comment/")[1].split(None, 1)[0])
comment = get_comment(comment)
comment.bannedfor = True
g.db.add(comment)

View File

@ -1,6 +1,6 @@
{%-
set CACHE_VER = {
'css/main.css': 293,
'css/main.css': 294,
'css/4chan.css': 59,
'css/classic.css': 59,