diff --git a/files/helpers/jinja2.py b/files/helpers/jinja2.py index 5316b40dd..6e4ed4554 100644 --- a/files/helpers/jinja2.py +++ b/files/helpers/jinja2.py @@ -27,7 +27,7 @@ def favorite_emojis(x): str = "" emojis = sorted(x.items(), key=lambda x: x[1], reverse=True)[:25] for k, v in emojis: - str += f'' + str += f'' return str @app.context_processor diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 8ec76f051..327084bef 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -219,8 +219,8 @@ def sanitize(sanitized, noimages=False): for i in re.finditer('

:([^ ]{1,30}?):

', sanitized): emoji = i.group(1).lower() - if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'): - sanitized = sanitized.replace(f'

:{emoji}:

', f'

:{emoji}:

') + if path.isfile(f'./files/assets/images/emojis2/{emoji}.webp'): + sanitized = sanitized.replace(f'

:{emoji}:

', f'

:{emoji}:

') try: if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1 @@ -230,8 +230,8 @@ def sanitize(sanitized, noimages=False): for i in re.finditer('\w*(?', sanitized) + if path.isfile(f'./files/assets/images/emojis2/{emoji}.webp'): + sanitized = re.sub(f'\w*(?', sanitized) try: if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1 diff --git a/files/routes/posts.py b/files/routes/posts.py index 03b81e69a..4e561ba8d 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -394,8 +394,8 @@ def filter_title(title): title = bleach.clean(title, tags=[]) for i in re.finditer(':(.{1,30}?):', title): - if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.webp'): - title = title.replace(f':{i.group(1)}:', f'') + if path.isfile(f'./files/assets/images/emojis2/{i.group(1)}.webp'): + title = title.replace(f':{i.group(1)}:', f'') return title diff --git a/files/routes/reporting.py b/files/routes/reporting.py index 6e30c0c15..a63804639 100644 --- a/files/routes/reporting.py +++ b/files/routes/reporting.py @@ -18,8 +18,8 @@ def api_flag_post(pid, v): if "<" in reason: return {"error": f"Reasons can't contain <"} for i in re.finditer(':(.{1,30}?):', reason): - if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.webp'): - reason = reason.replace(f':{i.group(1)}:', f'') + if path.isfile(f'./files/assets/images/emojis2/{i.group(1)}.webp'): + reason = reason.replace(f':{i.group(1)}:', f'') flag = Flag(post_id=post.id, user_id=v.id, @@ -49,8 +49,8 @@ def api_flag_comment(cid, v): if "<" in reason: return {"error": f"Reasons can't contain <"} for i in re.finditer(':(.{1,30}?):', reason): - if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.webp'): - reason = reason.replace(f':{i.group(1)}:', f'') + if path.isfile(f'./files/assets/images/emojis2/{i.group(1)}.webp'): + reason = reason.replace(f':{i.group(1)}:', f'') flag = CommentFlag(comment_id=comment.id, user_id=v.id, diff --git a/files/templates/emoji_modal.html b/files/templates/emoji_modal.html index 0180bd97d..4475a6bd3 100644 --- a/files/templates/emoji_modal.html +++ b/files/templates/emoji_modal.html @@ -1,4 +1,4 @@ - +