From 9aae09ad53c3326382a8fa0b0ad7a105b447a4e9 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 8 Oct 2021 18:06:12 +0200 Subject: [PATCH 001/206] dsf --- files/templates/settings2.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/templates/settings2.html b/files/templates/settings2.html index 52ee0c88b..84ab3d4b9 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -39,9 +39,11 @@ {% if v %} - + + {% else %} - + + {% endif %} From f4bddbbca0033b3ddf742d10af4932dff0cd26ac Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 8 Oct 2021 18:06:15 +0200 Subject: [PATCH 002/206] dsf --- files/__main__.py | 2 +- files/templates/authforms.html | 6 ++++-- files/templates/default.html | 4 +++- files/templates/log.html | 4 +++- files/templates/login.html | 1 + files/templates/login_2fa.html | 5 ++--- files/templates/settings.html | 4 ++-- files/templates/sign_up.html | 3 ++- files/templates/sign_up_failed_ref.html | 3 ++- files/templates/submit.html | 4 +++- files/templates/userpage.html | 4 +++- 11 files changed, 26 insertions(+), 14 deletions(-) diff --git a/files/__main__.py b/files/__main__.py index cce320c6e..57025e296 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -40,7 +40,7 @@ app.config["PERMANENT_SESSION_LIFETIME"] = 60 * 60 * 24 * 365 app.config["SESSION_REFRESH_EACH_REQUEST"] = True app.config["SLOGAN"] = environ.get("SLOGAN", "").strip() app.config["DEFAULT_COLOR"] = environ.get("DEFAULT_COLOR", "ff0000").strip() -app.config["DEFAULT_THEME"] = environ.get("DEFAULT_THEME", "light").strip() + "_" + environ.get("DEFAULT_COLOR", "ff0000").strip() +app.config["DEFAULT_THEME"] = environ.get("DEFAULT_THEME", "midnight").strip() app.config["FORCE_HTTPS"] = int(environ.get("FORCE_HTTPS", 1)) if ("localhost" not in app.config["SERVER_NAME"] and "127.0.0.1" not in app.config["SERVER_NAME"]) else 0 app.config["UserAgent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36" app.config["HCAPTCHA_SITEKEY"] = environ.get("HCAPTCHA_SITEKEY","").strip() diff --git a/files/templates/authforms.html b/files/templates/authforms.html index c7a0bdb2b..c0f0a5ce0 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -13,10 +13,12 @@ - {% if v %} - + {% if v %} + + {% if v.agendaposter %}{% endif %} {% else %} + {% endif %} diff --git a/files/templates/default.html b/files/templates/default.html index 3bf689877..9f60bbc3b 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -249,9 +249,11 @@ {% block stylesheets %} {% if v %} - + + {% if v.agendaposter %}{% endif %} {% else %} + {% endif %} diff --git a/files/templates/log.html b/files/templates/log.html index f5661ae64..6c91c45b7 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -16,9 +16,11 @@ {% if v %} - + + {% if v.agendaposter %}{% endif %} {% else %} + {% endif %} diff --git a/files/templates/login.html b/files/templates/login.html index 62c95fc65..9423cd651 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -15,6 +15,7 @@ + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 62ad32642..f041387db 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -11,9 +11,8 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - - - + + diff --git a/files/templates/settings.html b/files/templates/settings.html index 5d7f5fdff..75aee63ab 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -65,8 +65,8 @@ - - + + {% if v.agendaposter %}{% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 2b31f9991..c6b262802 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -35,7 +35,8 @@ - + + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 51b22861f..4a7e8eb09 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -30,7 +30,8 @@ - + + diff --git a/files/templates/submit.html b/files/templates/submit.html index 5c2eccd41..2a700174a 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -24,9 +24,11 @@ {% block stylesheets %} {% if v %} - + + {% if v.agendaposter %}{% endif %} {% else %} + {% endif %} {% endblock %} diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 56f28f938..b70b1ae4a 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -3,9 +3,11 @@ {% if u and u.profilecss %} {% block stylesheets %} {% if v %} - + + {% if v.agendaposter %}{% endif %} {% else %} + {% endif %} {% if u and u.profilecss %} From 920d2ed843c1cceffa8a703b95f4021666bfe9cc Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 8 Oct 2021 18:18:15 +0200 Subject: [PATCH 010/206] dfsdfs --- files/templates/authforms.html | 4 ++-- files/templates/default.html | 4 ++-- files/templates/log.html | 4 ++-- files/templates/login.html | 2 +- files/templates/login_2fa.html | 2 +- files/templates/settings.html | 2 +- files/templates/settings2.html | 4 ++-- files/templates/sign_up.html | 2 +- files/templates/sign_up_failed_ref.html | 2 +- files/templates/submit.html | 4 ++-- files/templates/userpage.html | 4 ++-- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/files/templates/authforms.html b/files/templates/authforms.html index c0f0a5ce0..049cf03a5 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,11 +15,11 @@ {% if v %} - + {% if v.agendaposter %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/default.html b/files/templates/default.html index 9f60bbc3b..e1f6e61bb 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -250,11 +250,11 @@ {% if v %} - + {% if v.agendaposter %}{% endif %} {% else %} - + {% endif %} {% endblock %} diff --git a/files/templates/log.html b/files/templates/log.html index 6c91c45b7..4200ebcb7 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -17,11 +17,11 @@ {% if v %} - + {% if v.agendaposter %}{% endif %} {% else %} - + {% endif %}
diff --git a/files/templates/login.html b/files/templates/login.html index 9423cd651..0a9e7ffff 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -16,7 +16,7 @@ - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index f041387db..139930b5b 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -12,7 +12,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index 75aee63ab..cbec4fd06 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -66,7 +66,7 @@ - + {% if v.agendaposter %}{% endif %} diff --git a/files/templates/settings2.html b/files/templates/settings2.html index 84ab3d4b9..6bca63c47 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -40,10 +40,10 @@ {% if v %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index c6b262802..0cf4bda32 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -36,7 +36,7 @@ - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 4a7e8eb09..4ba7b4b25 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -31,7 +31,7 @@ - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 2a700174a..b15ec0610 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -25,11 +25,11 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %}{% endif %} {% else %} - + {% endif %} {% endblock %} diff --git a/files/templates/userpage.html b/files/templates/userpage.html index b70b1ae4a..743b941ca 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -4,11 +4,11 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %}{% endif %} {% else %} - + {% endif %} {% if u and u.profilecss %} From 9b1043a9ca4e1b66989215885731dc6003f27e9c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 08:17:13 +0200 Subject: [PATCH 019/206] dfssdf --- files/routes/comments.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 09552ada4..b36b90478 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -849,7 +849,8 @@ def save_comment(cid, v): if not save: new_save=SaveRelationship(user_id=v.id, submission_id=comment.id, type=2) g.db.add(new_save) - g.db.commit() + try: g.db.commit() + except: g.db.rollback() return {"message": "Comment saved!"} From a17b20ca7cb237add579ee5b3b6b68c419a3b950 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 08:36:40 +0200 Subject: [PATCH 020/206] fdgdg --- files/routes/posts.py | 51 +++++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index edf8a8cf9..dc90055dd 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -509,19 +509,33 @@ def submit_post(v): url = url.replace(rd, "https://old.reddit.com/") url = url.replace("https://mobile.twitter.com", "https://twitter.com") - if url.startswith("https://streamable.com/") and not url.startswith("https://streamable.com/e/"): - url = url.replace("https://streamable.com/", "https://streamable.com/e/") + if url.startswith("https://streamable.com/") and not url.startswith("https://streamable.com/e/"): url = url.replace("https://streamable.com/", "https://streamable.com/e/") + + parsed_url = urlparse(url) + + domain = parsed_url.netloc + + qd = parse_qs(parsed_url.query) + filtered = dict((k, v) for k, v in qd.items() if not k.startswith('utm_')) + new_url = ParseResult(scheme="https", + netloc=parsed_url.netloc, + path=parsed_url.path, + params=parsed_url.params, + query=urlencode(filtered, doseq=True), + fragment=parsed_url.fragment) + url = urlunparse(new_url) repost = g.db.query(Submission).options(lazyload('*')).filter( Submission.url.ilike(f'{url}%'), Submission.deleted_utc == 0, Submission.is_banned == False ).first() - else: - repost = None + + if repost: return redirect(repost.permalink) - if repost: - return redirect(repost.permalink) + if not (parsed_url.scheme and parsed_url.netloc) and not request.values.get("body") and not request.files.get("file", None): + if request.headers.get("Authorization"): return {"error": "`url` or `body` parameter required."}, 400 + else: return render_template("submit.html", v=v, error="Please enter a url or some text.", title=title, url=url, body=request.values.get("body", "")), 400 if not title: if request.headers.get("Authorization"): return {"error": "Please enter a better title"}, 400 @@ -531,29 +545,9 @@ def submit_post(v): elif len(title) > 500: if request.headers.get("Authorization"): return {"error": "500 character limit for titles"}, 400 else: render_template("submit.html", v=v, error="500 character limit for titles.", title=title[:500], url=url, body=request.values.get("body", "")), 400 - - parsed_url = urlparse(url) - if not (parsed_url.scheme and parsed_url.netloc) and not request.values.get("body") and not request.files.get("file", None): - if request.headers.get("Authorization"): return {"error": "`url` or `body` parameter required."}, 400 - else: return render_template("submit.html", v=v, error="Please enter a url or some text.", title=title, url=url, body=request.values.get("body", "")), 400 - - - if request.values.get("url"): - qd = parse_qs(parsed_url.query) - filtered = dict((k, v) for k, v in qd.items() if not k.startswith('utm_')) - new_url = ParseResult(scheme="https", - netloc=parsed_url.netloc, - path=parsed_url.path, - params=parsed_url.params, - query=urlencode(filtered, doseq=True), - fragment=parsed_url.fragment) - url = urlunparse(new_url) - else: - url = "" body = request.values.get("body", "") dup = g.db.query(Submission).options(lazyload('*')).filter( - Submission.author_id == v.id, Submission.deleted_utc == 0, Submission.title == title, @@ -565,11 +559,6 @@ def submit_post(v): return redirect(dup.permalink) - - parsed_url = urlparse(url) - - domain = parsed_url.netloc - domain_obj = get_domain(domain) if domain_obj: if domain_obj.reason==4: From 10fb9dc9f504f10f16cf976fb2a5b1335a823d95 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 08:41:25 +0200 Subject: [PATCH 021/206] dsffsd --- files/routes/posts.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index dc90055dd..4c0c39b03 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -517,6 +517,7 @@ def submit_post(v): qd = parse_qs(parsed_url.query) filtered = dict((k, v) for k, v in qd.items() if not k.startswith('utm_')) + print(filtered) new_url = ParseResult(scheme="https", netloc=parsed_url.netloc, path=parsed_url.path, @@ -524,7 +525,8 @@ def submit_post(v): query=urlencode(filtered, doseq=True), fragment=parsed_url.fragment) url = urlunparse(new_url) - + print(url) + repost = g.db.query(Submission).options(lazyload('*')).filter( Submission.url.ilike(f'{url}%'), Submission.deleted_utc == 0, From 01b1f161c1e513a7d27a1882e51b284bc9f1b527 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 08:44:12 +0200 Subject: [PATCH 022/206] dfsf --- files/routes/posts.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 4c0c39b03..03817affc 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -517,7 +517,7 @@ def submit_post(v): qd = parse_qs(parsed_url.query) filtered = dict((k, v) for k, v in qd.items() if not k.startswith('utm_')) - print(filtered) + new_url = ParseResult(scheme="https", netloc=parsed_url.netloc, path=parsed_url.path, @@ -525,8 +525,7 @@ def submit_post(v): query=urlencode(filtered, doseq=True), fragment=parsed_url.fragment) url = urlunparse(new_url) - print(url) - + repost = g.db.query(Submission).options(lazyload('*')).filter( Submission.url.ilike(f'{url}%'), Submission.deleted_utc == 0, From 0088ec8ad5e4800d666c0ae936c79bd9da205bad Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 09:04:15 +0200 Subject: [PATCH 027/206] fgf --- files/templates/default.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/templates/default.html b/files/templates/default.html index e1f6e61bb..c0855395a 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -250,7 +250,8 @@ {% if v %} - + + {% if v.agendaposter %}{% endif %} {% else %} From d4e56b125aa7892d65c5a58a5162fa7049b8d4a6 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 09:05:16 +0200 Subject: [PATCH 029/206] fdsdf --- files/templates/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/templates/default.html b/files/templates/default.html index c0855395a..7eadc063d 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -250,7 +250,7 @@ {% if v %} - + {% if v.agendaposter %}{% endif %} {% else %} From f074335f642e9a41741f6071db0401ea221bdcad Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 09:21:22 +0200 Subject: [PATCH 032/206] dsfdsf --- compilecss.py | 7 ------- files/classes/user.py | 2 +- files/classes/userblock.py | 10 +--------- files/routes/settings.py | 3 --- files/templates/settings_profile.html | 4 ++-- files/templates/submission.html | 2 +- 6 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 compilecss.py diff --git a/compilecss.py b/compilecss.py deleted file mode 100644 index 923a70f22..000000000 --- a/compilecss.py +++ /dev/null @@ -1,7 +0,0 @@ -for theme in ['transparent', 'win98', 'midnight', 'dark', 'light', 'coffee', 'tron', '4chan']: - with open(f"./files/assets/css/{theme}_ff66ac.css", encoding='utf-8') as t: - text = t.read() - for color in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','62ca56','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58']: - newtext = text.replace("ff66ac", color).replace("ff4097", color).replace("ff1a83", color).replace("ff3390", color).replace("rgba(255, 102, 172, 0.25)", color) - with open(f"./files/assets/css/{theme}_{color}.css", encoding='utf-8', mode='w') as nt: - nt.write(newtext) \ No newline at end of file diff --git a/files/classes/user.py b/files/classes/user.py index 9b2c17e02..dd5030171 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -18,7 +18,7 @@ import random site = environ.get("DOMAIN").strip() site_name = environ.get("SITE_NAME").strip() -defaulttheme = environ.get("DEFAULT_THEME", "light").strip() +defaulttheme = environ.get("DEFAULT_THEME", "midnight").strip() defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip() defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip() cardview = bool(int(environ.get("CARD_VIEW", 1))) diff --git a/files/classes/userblock.py b/files/classes/userblock.py index b9be3092f..9a3ab1d70 100644 --- a/files/classes/userblock.py +++ b/files/classes/userblock.py @@ -1,8 +1,6 @@ from sqlalchemy import * from sqlalchemy.orm import relationship from files.__main__ import Base -from files.helpers.lazy import lazy -import time class UserBlock(Base): @@ -15,10 +13,4 @@ class UserBlock(Base): target = relationship("User", primaryjoin="User.id==UserBlock.target_id", viewonly=True) def __repr__(self): - - return f"" - - @property - @lazy - def created_date(self): - return time.strftime("%d %b %Y", time.gmtime(self.created_utc)) \ No newline at end of file + return f"" \ No newline at end of file diff --git a/files/routes/settings.py b/files/routes/settings.py index 8eb5ccac6..f4c0b2ee0 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -199,9 +199,6 @@ def settings_profile_post(v): theme = request.values.get("theme") if theme: v.theme = theme - if theme == "coffee" or theme == "4chan": v.themecolor = "38a169" - elif theme == "tron": v.themecolor = "80ffff" - elif theme == "win98": v.themecolor = "30409f" updated = True quadrant = request.values.get("quadrant") diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html index 2a249b978..9af7b886c 100644 --- a/files/templates/settings_profile.html +++ b/files/templates/settings_profile.html @@ -97,9 +97,9 @@
- {% if "rdrama" in request.host %} + {% if "rama" in request.host %}
From 5daa6cac77dda228816c04347142255d7ab359dc Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 09:40:17 +0200 Subject: [PATCH 037/206] dfsfds --- files/templates/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/templates/default.html b/files/templates/default.html index 1c671d586..4beb87031 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -270,7 +270,7 @@ {% if "marsey.tech" not in request.host and '@' not in request.path %} - + {% endif %} From b61c0e86f414a10d89a26ef5086bc1a614cfcd8f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 09:42:15 +0200 Subject: [PATCH 038/206] dsfdsf --- files/templates/delete_post_modal.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/files/templates/delete_post_modal.html b/files/templates/delete_post_modal.html index 5b355c79f..7ae94dc73 100644 --- a/files/templates/delete_post_modal.html +++ b/files/templates/delete_post_modal.html @@ -36,10 +36,6 @@
- - - -
Delete post?
From d5ddc816c4ce1f1fb349016da96e09098e7d986a Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 15:49:13 +0200 Subject: [PATCH 041/206] fdssfd --- files/routes/comments.py | 4 ++-- files/routes/posts.py | 4 ++-- files/routes/settings.py | 3 ++- files/templates/email/default.html | 7 ------- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 77245dbb8..368b67cc0 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -148,7 +148,7 @@ def api_comment(v): if not body and not request.files.get('file'): return {"error":"You need to actually write something!"}, 400 - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): + for i in re.finditer('(^| )(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})') body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body) @@ -579,7 +579,7 @@ def edit_comment(cid, v): if c.is_banned or c.deleted_utc > 0: abort(403) body = request.values.get("body", "")[:10000] - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): + for i in re.finditer('(^| )(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})') body_md = CustomRenderer().render(mistletoe.Document(body)) body_html = sanitize(body_md) diff --git a/files/routes/posts.py b/files/routes/posts.py index e0152e4f1..5464f251d 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -206,7 +206,7 @@ def edit_post(pid, v): p.title_html = filter_title(title) if body != p.body: - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): + for i in re.finditer('(^| )(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})') body_md = CustomRenderer().render(mistletoe.Document(body)) body_html = sanitize(body_md) @@ -665,7 +665,7 @@ def submit_post(v): if request.headers.get("Authorization"): return {"error":"2048 character limit for URLs."}, 400 else: return render_template("submit.html", v=v, error="2048 character limit for URLs.", title=title, url=url,body=request.values.get("body", "")), 400 - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): + for i in re.finditer('(^| )(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})') body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body) diff --git a/files/routes/settings.py b/files/routes/settings.py index c6e122ebf..2fb6466af 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -103,7 +103,7 @@ def settings_profile_post(v): if request.values.get("bio"): bio = request.values.get("bio")[:1500] - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', bio, re.MULTILINE): + for i in re.finditer('(^| )(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', bio, re.MULTILINE): if "wikipedia" not in i.group(1): bio = bio.replace(i.group(1), f'![]({i.group(1)})') bio = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', bio) @@ -199,6 +199,7 @@ def settings_profile_post(v): theme = request.values.get("theme") if theme: v.theme = theme + if theme == "win98": v.themecolor = "30409f" updated = True quadrant = request.values.get("quadrant") diff --git a/files/templates/email/default.html b/files/templates/email/default.html index f5396d90a..476d4faa6 100644 --- a/files/templates/email/default.html +++ b/files/templates/email/default.html @@ -366,13 +366,6 @@ } } - {% block preheader %}Thanks for joining {{'SITE_NAME' | app_config}}! Please take a sec to verify the email you used to sign up.{% endblock %} From 84840d9fa05c961f1c82d29ed65bb19eff22bb3c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 16:02:47 +0200 Subject: [PATCH 042/206] dsfsfd --- files/templates/header.html | 2 +- files/templates/mobile_navigation_bar.html | 12 ++++++------ files/templates/notifications.html | 2 +- files/templates/settings.html | 11 ----------- files/templates/settings_security.html | 16 ++++++++++++---- 5 files changed, 20 insertions(+), 23 deletions(-) diff --git a/files/templates/header.html b/files/templates/header.html index 15414bd7e..bfb1dfe9f 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -96,7 +96,7 @@
{{v.username}}
-
{{v.coins}} {{'COINS_NAME' | app_config}}
+
{{v.coins}} {{'COINS_NAME' | app_config}}
diff --git a/files/templates/mobile_navigation_bar.html b/files/templates/mobile_navigation_bar.html index 72466e002..49e65868a 100644 --- a/files/templates/mobile_navigation_bar.html +++ b/files/templates/mobile_navigation_bar.html @@ -13,7 +13,7 @@ + + + +
diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html index 9af7b886c..e283011c6 100644 --- a/files/templates/settings_profile.html +++ b/files/templates/settings_profile.html @@ -439,7 +439,7 @@
- +     Limit of 100 characters diff --git a/files/templates/submission.html b/files/templates/submission.html index 30479954b..bfc83d7a6 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -405,10 +405,10 @@
- - - - + + + + Cancel
diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 3168d69e9..0c855f0f2 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -241,7 +241,7 @@
- +    
@@ -505,7 +505,7 @@
- +    
From aac3f3dee873945f7316c352a3ab8c18c6e4cec1 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 17:38:26 +0200 Subject: [PATCH 060/206] fdsfsd --- files/templates/header.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/templates/header.html b/files/templates/header.html index c39e68099..d4342b79c 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -122,7 +122,11 @@ {% endif %} Changelog + Source code + + Report bugs + Discord {% if 'pcm' not in request.host %}Donate{% endif %} {% if 'rama' in request.host %}Archives{% endif %} @@ -184,7 +188,7 @@ Source code - Report bugs + Report bugs Discord {% if 'pcm' not in request.host %}Donate{% endif %} From 1ad9bf6f77988c2876ddbaf7627f053747f1f56c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 17:41:05 +0200 Subject: [PATCH 061/206] dgdgf --- files/templates/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/templates/default.html b/files/templates/default.html index dfbfe56d1..435ce1a29 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -270,7 +270,7 @@ {% if "marsey.tech" not in request.host and '@' not in request.path %} - + {% endif %} From b08b97aec93cbdd2b9417905f419ef32114b59c4 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 17:43:57 +0200 Subject: [PATCH 062/206] dsfsdf --- files/routes/posts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index a00344141..435a22bed 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -206,7 +206,7 @@ def edit_post(pid, v): p.title_html = filter_title(title) if body != p.body: - for i in re.finditer('(^| )(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): + for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})') body_md = CustomRenderer().render(mistletoe.Document(body)) body_html = sanitize(body_md) @@ -558,7 +558,7 @@ def submit_post(v): embed = id else: embed = None else: embed = None - + if not url and not request.values.get("body") and not request.files.get("file", None): if request.headers.get("Authorization"): return {"error": "`url` or `body` parameter required."}, 400 else: return render_template("submit.html", v=v, error="Please enter a url or some text.", title=title, url=url, body=request.values.get("body", "")), 400 @@ -648,7 +648,7 @@ def submit_post(v): if request.headers.get("Authorization"): return {"error":"2048 character limit for URLs."}, 400 else: return render_template("submit.html", v=v, error="2048 character limit for URLs.", title=title, url=url,body=request.values.get("body", "")), 400 - for i in re.finditer('(^| )(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): + for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})') body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body) From 81f12a54a7a5c30b0515284d97bdb28a506d2ebd Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 17:48:42 +0200 Subject: [PATCH 063/206] dfssfd --- files/templates/authforms.html | 6 +++--- files/templates/award_modal.html | 2 +- files/templates/changelog.html | 2 +- files/templates/comments.html | 4 ++-- files/templates/default.html | 14 +++++++------- files/templates/emoji_modal.html | 2 +- files/templates/gif_modal.html | 2 +- files/templates/header.html | 2 +- files/templates/log.html | 6 +++--- files/templates/login.html | 4 ++-- files/templates/login_2fa.html | 2 +- files/templates/mobile_navigation_bar.html | 2 +- files/templates/report_post_modal.html | 2 +- files/templates/settings.html | 6 +++--- files/templates/settings2.html | 6 +++--- files/templates/settings_profile.html | 2 +- files/templates/sign_up.html | 4 ++-- files/templates/sign_up_failed_ref.html | 2 +- files/templates/submission.html | 8 ++++---- files/templates/submission_listing.html | 2 +- files/templates/submit.html | 12 ++++++------ files/templates/userpage.html | 8 ++++---- 22 files changed, 50 insertions(+), 50 deletions(-) diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 049cf03a5..3059e2154 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,11 +15,11 @@ {% if v %} - - {% if v.agendaposter %}{% endif %} + + {% if v.agendaposter %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/award_modal.html b/files/templates/award_modal.html index 66c394ee5..fd5640fe5 100644 --- a/files/templates/award_modal.html +++ b/files/templates/award_modal.html @@ -1,4 +1,4 @@ - +