From 1e5a59c4beda18eb08f867e42598b3e41db17fe1 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 29 Sep 2021 17:42:28 +0200 Subject: [PATCH] dsf --- files/helpers/jinja2.py | 2 +- files/helpers/sanitize.py | 8 ++++---- files/routes/posts.py | 4 ++-- files/routes/reporting.py | 8 ++++---- files/templates/errors/400.html | 2 +- files/templates/errors/401.html | 2 +- files/templates/errors/403.html | 2 +- files/templates/errors/404.html | 2 +- files/templates/errors/405.html | 2 +- files/templates/errors/429.html | 2 +- files/templates/errors/500.html | 2 +- files/templates/errors/nsfw.html | 2 +- files/templates/errors/patron.html | 2 +- files/templates/formatting.html | 2 +- files/templates/submission_listing.html | 2 +- files/templates/userpage.html | 4 ++-- 16 files changed, 24 insertions(+), 24 deletions(-) diff --git a/files/helpers/jinja2.py b/files/helpers/jinja2.py index 6e4ed4554..5316b40dd 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 327084bef..8ec76f051 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/emojis2/{emoji}.webp'): - sanitized = sanitized.replace(f'

:{emoji}:

', f'

:{emoji}:

') + if path.isfile(f'./files/assets/images/emojis/{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/emojis/{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 4e561ba8d..03b81e69a 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/emojis2/{i.group(1)}.webp'): - title = title.replace(f':{i.group(1)}:', f'') + if path.isfile(f'./files/assets/images/emojis/{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 a63804639..6e30c0c15 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/emojis2/{i.group(1)}.webp'): - reason = reason.replace(f':{i.group(1)}:', f'') + if path.isfile(f'./files/assets/images/emojis/{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/emojis2/{i.group(1)}.webp'): - reason = reason.replace(f':{i.group(1)}:', f'') + if path.isfile(f'./files/assets/images/emojis/{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/errors/400.html b/files/templates/errors/400.html index 473e5e116..29a3dc90a 100644 --- a/files/templates/errors/400.html +++ b/files/templates/errors/400.html @@ -10,7 +10,7 @@
- +

 			

400 Bad Request

That request was bad and you should feel bad.

diff --git a/files/templates/errors/401.html b/files/templates/errors/401.html index 7cfb5197f..c7168c6ee 100644 --- a/files/templates/errors/401.html +++ b/files/templates/errors/401.html @@ -11,7 +11,7 @@
- +

 
 			

401 Not Authorized

diff --git a/files/templates/errors/403.html b/files/templates/errors/403.html index 884941faf..f24128f90 100644 --- a/files/templates/errors/403.html +++ b/files/templates/errors/403.html @@ -10,7 +10,7 @@
- +

 		

403 Forbidden

YOU AREN'T WELCOME HERE GO AWAY

diff --git a/files/templates/errors/404.html b/files/templates/errors/404.html index adfd85ad9..0923c7200 100644 --- a/files/templates/errors/404.html +++ b/files/templates/errors/404.html @@ -10,7 +10,7 @@
- +

 		

404 Page Not Found

Someone typed something wrong and it was probably you, please do better.

diff --git a/files/templates/errors/405.html b/files/templates/errors/405.html index 333006af6..5d4e33a3f 100644 --- a/files/templates/errors/405.html +++ b/files/templates/errors/405.html @@ -10,7 +10,7 @@
- +

 		

405 Method Not Allowed

idk how anyone gets this error but if you see this, remember to follow @carpathianflorist
the original error text here talked about internet gremlins and wtf

diff --git a/files/templates/errors/429.html b/files/templates/errors/429.html index 0cfa013b8..294ce82e6 100644 --- a/files/templates/errors/429.html +++ b/files/templates/errors/429.html @@ -10,7 +10,7 @@
- +

 		

429 Too Many Requests

go spam somewhere else nerd

diff --git a/files/templates/errors/500.html b/files/templates/errors/500.html index 014c5795b..bddbdf3b9 100644 --- a/files/templates/errors/500.html +++ b/files/templates/errors/500.html @@ -10,7 +10,7 @@
- +

 			

500 Internal Server Error

Hiiiii it's carp! I think this error means that there's a timeout error. And I think that means something took too long to load so it decided not to work at all. If you keep seeing this on the same page but not other pages, then something is probably wrong with that specific function. It may not be called a function, but that sounds right to me. Anyway, ping me and I'll whine to someone smarter to fix it. Don't bother them. Thanks ily <3

diff --git a/files/templates/errors/nsfw.html b/files/templates/errors/nsfw.html index 4080315d4..25450c275 100644 --- a/files/templates/errors/nsfw.html +++ b/files/templates/errors/nsfw.html @@ -10,7 +10,7 @@
- +

Are you over 18?

This post is rated +18 (Adult-Only). You must be 18 or older to continue. Are you sure you want to proceed?

diff --git a/files/templates/errors/patron.html b/files/templates/errors/patron.html index deae41769..2fa38c45f 100644 --- a/files/templates/errors/patron.html +++ b/files/templates/errors/patron.html @@ -10,7 +10,7 @@
- +

401 Not Authorized

This page is only available to {% if "rdrama" in request.host %}paypigs{% else %}patrons{% endif %}:

{{'GUMROAD_LINK' | app_config}} diff --git a/files/templates/formatting.html b/files/templates/formatting.html index 82350df0f..f1b44e60e 100644 --- a/files/templates/formatting.html +++ b/files/templates/formatting.html @@ -55,7 +55,7 @@ On {{'SITE_NAME' | app_config}}, you can use Markdown formatting. Emojis :marseylove: - + diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 852549f31..c6ffef812 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -93,7 +93,7 @@
{% if p.club and not (v and v.paid_dues) %} - + {% elif not p.url %} diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 301f4f03f..894c1614e 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -131,7 +131,7 @@ {% if u.customtitle %}

{% if u.quadrant %}{% endif %}{{u.customtitle | safe}}

{% endif %}
{{u.coins}} -     +     {% if u.stored_subscriber_count >=1 and not u.is_nofollow %}{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}   {% endif %} joined {{u.created_date}} @@ -388,7 +388,7 @@
{{u.coins}} -     +     {% if u.stored_subscriber_count >=1 and not u.is_nofollow %}{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}   {% endif %} {% if "pcm" in request.host %}
Based count: {{u.basedcount}}