diff --git a/files/helpers/const.py b/files/helpers/const.py index 70d28972b..004641f26 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -688,7 +688,7 @@ title_regex = re.compile("[^\w ]", flags=re.A) based_regex = re.compile("based and (.{1,20}?)(-| )pilled", flags=re.I|re.A) -controversial_regex = re.compile('(/comments/.*?)"', flags=re.A) +controversial_regex = re.compile('["> ](https:\/\/old.reddit.com/r/[a-zA-Z0-9_]{3,20}\/comments\/.*?)["< ]', flags=re.A) fishylinks_regex = re.compile("https?://\S+", flags=re.A) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 5717d13a2..c1369892b 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -119,7 +119,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False): sanitized = strikethrough_regex.sub(r'\1', sanitized) - sanitized = sanitized.replace("\ufeff", "").replace("𒐪","").replace("","").replace('‎','') + sanitized = sanitized.replace("\ufeff", "").replace("𒐪","").replace("","").replace('‎','').replace('​','') if alert: captured = [] diff --git a/files/routes/posts.py b/files/routes/posts.py index 41331faaf..f426ea1b3 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -1236,6 +1236,7 @@ def submit_post(v, sub=None): rev = post.url.replace('https://old.reddit.com/', '') rev = f"* [unddit.com](https://unddit.com/{rev})\n" else: rev = '' + newposturl = post.url if newposturl.startswith('/'): newposturl = f"{SITE_FULL}{newposturl}" body += f"Snapshots:\n\n{rev}* [archive.org](https://web.archive.org/{newposturl})\n* [archive.ph](https://archive.ph/?url={quote(newposturl)}&run=1) (click to archive)\n\n" diff --git a/files/templates/chat.html b/files/templates/chat.html index edc03ed43..12eae8f0c 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -22,7 +22,7 @@