mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 11:11:13 +08:00
SECURITY: Stripping links could unescape html fragments
This commit is contained in:
@ -250,7 +250,7 @@ module PrettyText
|
||||
|
||||
# If the user is not basic, strip links from their bio
|
||||
fragment = Nokogiri::HTML.fragment(string)
|
||||
fragment.css('a').each {|a| a.replace(a.text) }
|
||||
fragment.css('a').each {|a| a.replace(a.inner_html) }
|
||||
fragment.to_html
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user