forked from rDrama/rDrama
patch hole https://imgur.com/a/2xPrzrZ
parent
3f8a47bbc1
commit
e63df33a2a
|
@ -96,8 +96,14 @@ def notif_comment(text):
|
||||||
|
|
||||||
|
|
||||||
def notif_comment2(p):
|
def notif_comment2(p):
|
||||||
|
if p.ghost:
|
||||||
|
author_link = '@👻'
|
||||||
|
else:
|
||||||
|
author_link = f'<a href="/id/{p.author_id}" rel="nofollow"><img loading="lazy" src="/pp/{p.author_id}">@{p.author_name}</a>'
|
||||||
|
|
||||||
text = f"@{p.author_name} has mentioned you: [{p.title}](/post/{p.id})"
|
sanitized_title = filter_emojis_only(p.title)
|
||||||
|
|
||||||
|
text = f'{author_link} has mentioned you: <a href="/post/{p.id}">{sanitized_title}</a>'
|
||||||
|
|
||||||
search_html = f'%</a> has mentioned you: <a href="/post/{p.id}"%'
|
search_html = f'%</a> has mentioned you: <a href="/post/{p.id}"%'
|
||||||
|
|
||||||
|
@ -106,8 +112,7 @@ def notif_comment2(p):
|
||||||
if existing: return existing[0], text
|
if existing: return existing[0], text
|
||||||
else:
|
else:
|
||||||
if p.hole: text += f" in <a href='/h/{p.hole}'>/h/{p.hole}"
|
if p.hole: text += f" in <a href='/h/{p.hole}'>/h/{p.hole}"
|
||||||
text_html = sanitize(text, blackjack="notification", post_mention_notif=True)
|
return create_comment(text), text
|
||||||
return create_comment(text_html), text
|
|
||||||
|
|
||||||
|
|
||||||
def add_notif(cid, uid, text, pushnotif_url=''):
|
def add_notif(cid, uid, text, pushnotif_url=''):
|
||||||
|
|
|
@ -359,7 +359,7 @@ def handle_youtube_links(url):
|
||||||
return html
|
return html
|
||||||
|
|
||||||
@with_sigalrm_timeout(10)
|
@with_sigalrm_timeout(10)
|
||||||
def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis=False, snappy=False, chat=False, blackjack=None, post_mention_notif=False, commenters_ping_post_id=None, obj=None, author=None):
|
def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis=False, snappy=False, chat=False, blackjack=None, commenters_ping_post_id=None, obj=None, author=None):
|
||||||
def error(error):
|
def error(error):
|
||||||
if chat:
|
if chat:
|
||||||
return error, 403
|
return error, 403
|
||||||
|
@ -602,7 +602,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
|
||||||
continue
|
continue
|
||||||
|
|
||||||
#don't allow something like this [https://rԁrama.net/leaderboard](https://iplogger.org/1fRKk7)
|
#don't allow something like this [https://rԁrama.net/leaderboard](https://iplogger.org/1fRKk7)
|
||||||
if not snappy and not post_mention_notif:
|
if not snappy:
|
||||||
string_domain = tldextract.extract(str(link.string)).registered_domain
|
string_domain = tldextract.extract(str(link.string)).registered_domain
|
||||||
if string_domain and string_domain != tldextract.extract(href).registered_domain:
|
if string_domain and string_domain != tldextract.extract(href).registered_domain:
|
||||||
link.string = href
|
link.string = href
|
||||||
|
|
Loading…
Reference in New Issue