Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost

remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-10-29 16:50:47 -05:00
commit eca1edeaf6
8 changed files with 12 additions and 12 deletions

View File

@ -26,7 +26,7 @@ export function Username({ avatar, color, name, hat = "" }: UsernameProps) {
style={{ color: `#${color}` }}
target="_blank"
href={`/@${name}`}
rel="nofollow noopener noreferrer"
rel="nofollow noopener"
>
{name}
</a>

File diff suppressed because one or more lines are too long

View File

@ -72,7 +72,7 @@ def notify_mentions(send_to, mentions, mention_str='site mention'):
permalink = m['permalink']
text = sanitize(m['text'], golden=False)
notif_text = \
f"""<p>New {mention_str} by <a href="https://old.reddit.com/u/{author}" rel="nofollow noopener noreferrer" target="_blank">/u/{author}</a></p><p><a href="https://old.reddit.com{permalink}?context=89" rel="nofollow noopener noreferrer" target="_blank">https://old.reddit.com{permalink}?context=89</a></p>{text}"""
f"""<p>New {mention_str} by <a href="https://old.reddit.com/u/{author}" rel="nofollow noopener" target="_blank">/u/{author}</a></p><p><a href="https://old.reddit.com{permalink}?context=89" rel="nofollow noopener" target="_blank">https://old.reddit.com{permalink}?context=89</a></p>{text}"""
existing_comment = g.db.query(Comment.id).filter_by(
author_id=const.AUTOJANNY_ID,

View File

@ -36,7 +36,7 @@ def allowed_attributes(tag, name, value):
if tag == 'a':
if name == 'href' and '\\' not in value and 'xn--' not in value:
return True
if name == 'rel' and value == 'nofollow noopener noreferrer': return True
if name == 'rel' and value == 'nofollow noopener': return True
if name == 'target' and value == '_blank': return True
return False
@ -119,7 +119,7 @@ def callback(attrs, new=False):
if not href.startswith('/') and not href.startswith(f'{SITE_FULL}/'):
attrs[(None, "target")] = "_blank"
attrs[(None, "rel")] = "nofollow noopener noreferrer"
attrs[(None, "rel")] = "nofollow noopener"
return attrs
@ -234,7 +234,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys
# replacing zero width characters, overlines, fake colons
sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace("\ufeff", "").replace("\u033f","").replace("\u0589", ":")
sanitized = reddit_regex.sub(r'\1<a href="https://old.reddit.com/\2" rel="nofollow noopener noreferrer" target="_blank">/\2</a>', sanitized)
sanitized = reddit_regex.sub(r'\1<a href="https://old.reddit.com/\2" rel="nofollow noopener" target="_blank">/\2</a>', sanitized)
sanitized = sub_regex.sub(r'\1<a href="/\2">/\2</a>', sanitized)
v = getattr(g, 'v', None)
@ -261,7 +261,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys
for tag in soup.find_all("img"):
if tag.get("src") and not tag["src"].startswith('/pp/'):
if not is_safe_url(tag["src"]):
a = soup.new_tag("a", href=tag["src"], rel="nofollow noopener noreferrer", target="_blank")
a = soup.new_tag("a", href=tag["src"], rel="nofollow noopener", target="_blank")
a.string = tag["src"]
tag.replace_with(a)
continue
@ -274,7 +274,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys
if tag.parent.name != 'a':
a = soup.new_tag("a", href=tag["data-src"])
if not is_site_url(a["href"]):
a["rel"] = "nofollow noopener noreferrer"
a["rel"] = "nofollow noopener"
a["target"] = "_blank"
tag = tag.replace_with(a)
a.append(tag)

View File

@ -695,7 +695,7 @@ def submit_post(v, sub=None):
if "twitter.com" == domain:
try:
embed = requests.get("https://publish.twitter.com/oembed", params={"url":url, "omit_script":"t"}, timeout=5).json()["html"]
embed = embed.replace('<a href', '<a rel="nofollow noopener noreferrer" href')
embed = embed.replace('<a href', '<a rel="nofollow noopener" href')
except: pass
elif url.startswith('https://youtube.com/watch?v='):
url = unquote(url).replace('?t', '&t')

View File

@ -87,7 +87,7 @@
</head>
<body id="error-502">
<a rel="nofollow noopener noreferrer" href="https://secure.transequality.org/site/Donation2?df_id=1480">
<a rel="nofollow noopener" href="https://secure.transequality.org/site/Donation2?df_id=1480">
<img alt="site banner" src="/i/PCM/cached.webp?v=3009" width="100%">
</a>

View File

@ -87,7 +87,7 @@
</head>
<body id="error-502">
<a rel="nofollow noopener noreferrer" href="https://secure.transequality.org/site/Donation2?df_id=1480">
<a rel="nofollow noopener" href="https://secure.transequality.org/site/Donation2?df_id=1480">
<img alt="site banner" src="/i/WPD/cached.webp?v=3009" width="100%">
</a>

View File

@ -87,7 +87,7 @@
</head>
<body id="error-502">
<a rel="nofollow noopener noreferrer" href="https://secure.transequality.org/site/Donation2?df_id=1480">
<a rel="nofollow noopener" href="https://secure.transequality.org/site/Donation2?df_id=1480">
<img alt="site banner" src="/i/rDrama/cached.webp?v=3009" width="100%">
</a>