mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:21:12 +08:00
Escape values of HTML attributes
This commit is contained in:

committed by
Robin Ward

parent
7dc8f8b794
commit
d54b339809
@ -256,7 +256,7 @@ class DiscourseDiff
|
||||
USELESS_TAGS = %w{html body}
|
||||
def start_element(name, attributes = [])
|
||||
return if USELESS_TAGS.include?(name)
|
||||
attrs = attributes.map { |a| " #{a[0]}=\"#{a[1]}\"" }.join
|
||||
attrs = attributes.map { |a| " #{a[0]}=\"#{CGI::escapeHTML(a[1])}\"" }.join
|
||||
@tokens << "<#{name}#{attrs}>"
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user