forked from rDrama/rDrama
remove redundant "noreferrer"
parent
ef4fc4dd99
commit
227d074da7
|
@ -26,7 +26,7 @@ export function Username({ avatar, color, name, hat = "" }: UsernameProps) {
|
||||||
style={{ color: `#${color}` }}
|
style={{ color: `#${color}` }}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
href={`/@${name}`}
|
href={`/@${name}`}
|
||||||
rel="nofollow noopener noreferrer"
|
rel="nofollow noopener"
|
||||||
>
|
>
|
||||||
{name}
|
{name}
|
||||||
</a>
|
</a>
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -72,7 +72,7 @@ def notify_mentions(send_to, mentions, mention_str='site mention'):
|
||||||
permalink = m['permalink']
|
permalink = m['permalink']
|
||||||
text = sanitize(m['text'], golden=False)
|
text = sanitize(m['text'], golden=False)
|
||||||
notif_text = \
|
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(
|
existing_comment = g.db.query(Comment.id).filter_by(
|
||||||
author_id=const.AUTOJANNY_ID,
|
author_id=const.AUTOJANNY_ID,
|
||||||
|
|
|
@ -36,7 +36,7 @@ def allowed_attributes(tag, name, value):
|
||||||
if tag == 'a':
|
if tag == 'a':
|
||||||
if name == 'href' and '\\' not in value and 'xn--' not in value:
|
if name == 'href' and '\\' not in value and 'xn--' not in value:
|
||||||
return True
|
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
|
if name == 'target' and value == '_blank': return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ def callback(attrs, new=False):
|
||||||
|
|
||||||
if not href.startswith('/') and not href.startswith(f'{SITE_FULL}/'):
|
if not href.startswith('/') and not href.startswith(f'{SITE_FULL}/'):
|
||||||
attrs[(None, "target")] = "_blank"
|
attrs[(None, "target")] = "_blank"
|
||||||
attrs[(None, "rel")] = "nofollow noopener noreferrer"
|
attrs[(None, "rel")] = "nofollow noopener"
|
||||||
|
|
||||||
return attrs
|
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
|
# replacing zero width characters, overlines, fake colons
|
||||||
sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace("\ufeff", "").replace("\u033f","").replace("\u0589", ":")
|
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)
|
sanitized = sub_regex.sub(r'\1<a href="/\2">/\2</a>', sanitized)
|
||||||
|
|
||||||
v = getattr(g, 'v', None)
|
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"):
|
for tag in soup.find_all("img"):
|
||||||
if tag.get("src") and not tag["src"].startswith('/pp/'):
|
if tag.get("src") and not tag["src"].startswith('/pp/'):
|
||||||
if not is_safe_url(tag["src"]):
|
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"]
|
a.string = tag["src"]
|
||||||
tag.replace_with(a)
|
tag.replace_with(a)
|
||||||
continue
|
continue
|
||||||
|
@ -274,7 +274,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys
|
||||||
if tag.parent.name != 'a':
|
if tag.parent.name != 'a':
|
||||||
a = soup.new_tag("a", href=tag["data-src"])
|
a = soup.new_tag("a", href=tag["data-src"])
|
||||||
if not is_site_url(a["href"]):
|
if not is_site_url(a["href"]):
|
||||||
a["rel"] = "nofollow noopener noreferrer"
|
a["rel"] = "nofollow noopener"
|
||||||
a["target"] = "_blank"
|
a["target"] = "_blank"
|
||||||
tag = tag.replace_with(a)
|
tag = tag.replace_with(a)
|
||||||
a.append(tag)
|
a.append(tag)
|
||||||
|
|
|
@ -695,7 +695,7 @@ def submit_post(v, sub=None):
|
||||||
if "twitter.com" == domain:
|
if "twitter.com" == domain:
|
||||||
try:
|
try:
|
||||||
embed = requests.get("https://publish.twitter.com/oembed", params={"url":url, "omit_script":"t"}, timeout=5).json()["html"]
|
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
|
except: pass
|
||||||
elif url.startswith('https://youtube.com/watch?v='):
|
elif url.startswith('https://youtube.com/watch?v='):
|
||||||
url = unquote(url).replace('?t', '&t')
|
url = unquote(url).replace('?t', '&t')
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="error-502">
|
<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%">
|
<img alt="site banner" src="/i/PCM/cached.webp?v=3009" width="100%">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="error-502">
|
<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%">
|
<img alt="site banner" src="/i/WPD/cached.webp?v=3009" width="100%">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="error-502">
|
<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%">
|
<img alt="site banner" src="/i/rDrama/cached.webp?v=3009" width="100%">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue