mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FIX: add rel noopener and noreferrer in addition to nofollow
This commit is contained in:
parent
18156719bd
commit
7cb76f7333
6 changed files with 16 additions and 16 deletions
|
@ -261,11 +261,11 @@ module PrettyText
|
|||
whitelist.any?{|u| uri.host == u || uri.host.ends_with?("." << u)}
|
||||
# we are good no need for nofollow
|
||||
else
|
||||
l["rel"] = "nofollow"
|
||||
l["rel"] = "nofollow noopener noreferrer"
|
||||
end
|
||||
rescue URI::InvalidURIError, URI::InvalidComponentError
|
||||
# add a nofollow anyway
|
||||
l["rel"] = "nofollow"
|
||||
l["rel"] = "nofollow noopener noreferrer"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue