Skip to content

Commit

Permalink
Improvement for issue zammad#952 - External links in html emails will…
Browse files Browse the repository at this point in the history
… be open in local context.
  • Loading branch information
martini committed Apr 17, 2017
1 parent 4b332b4 commit 449d190
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 122 deletions.
4 changes: 2 additions & 2 deletions lib/html_sanitizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def self.strict(string, external = false)
end
next if !href.downcase.start_with?('http', 'ftp', '//')
node.set_attribute('href', href)
node.set_attribute('rel', 'nofollow')
node.set_attribute('rel', 'nofollow noreferrer noopener')
node.set_attribute('target', '_blank')
end

Expand Down Expand Up @@ -338,7 +338,7 @@ def self.add_link(content, urls, node)

a = Nokogiri::XML::Node.new 'a', node.document
a['href'] = url
a['rel'] = 'nofollow'
a['rel'] = 'nofollow noreferrer noopener'
a['target'] = '_blank'
a.content = url

Expand Down
Loading

0 comments on commit 449d190

Please sign in to comment.