1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2025-01-25 00:25:12 +00:00

Use rel attributes on links in the info field (#463)

This commit is contained in:
Nicolas F 2018-03-26 01:30:57 +02:00 committed by Arylide
parent e9b1f6a6c4
commit ad5ea6d91e

View file

@ -221,7 +221,8 @@ class TorrentBase(DeclarativeHelperBase):
invalid_url_characters = '<>"'
# Check if url contains invalid characters
if not any(c in url for c in invalid_url_characters):
return '<a href="{0}">{1}</a>'.format(url, escape_markup(unquote_url(url)))
return('<a rel="noopener noreferrer nofollow" '
'href="{0}">{1}</a>'.format(url, escape_markup(unquote_url(url))))
# Escaped
return escape_markup(self.information)