Skip to content

Commit

Permalink
Merge pull request #4225 from mzazrivec/escape_text_and_tooltip_in_tr…
Browse files Browse the repository at this point in the history
…eebuilders_root

Escape special chars in tooltip & text of TreeBuilder's root
  • Loading branch information
martinpovolny authored Jun 29, 2018
2 parents 4c88630 + 522bded commit c94908f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/presenters/tree_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def add_to_sandbox
end

def add_root_node(nodes)
root = nodes.first.merge!(root_options)
root = nodes.first.merge!(%i(text tooltip).each_with_object(root_options) { |key, hsh| hsh[key] = ERB::Util.html_escape(hsh[key]) })
if root[:image]
root[:image] = ActionController::Base.helpers.image_path(root[:image])
else
Expand Down

0 comments on commit c94908f

Please sign in to comment.