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
1 changed files with 2 additions and 1 deletions

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)