diff options
-rw-r--r-- | lib/redmine/wiki_formatting/macros.rb | 2 | ||||
-rw-r--r-- | test/unit/lib/redmine/wiki_formatting/macros_test.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/redmine/wiki_formatting/macros.rb b/lib/redmine/wiki_formatting/macros.rb index 4de145c4c..ef1135cb6 100644 --- a/lib/redmine/wiki_formatting/macros.rb +++ b/lib/redmine/wiki_formatting/macros.rb @@ -53,7 +53,7 @@ module Redmine send(method_name, obj, args) end rescue => e - %|<div class="flash error">#{::I18n.t(:error_can_not_execute_macro_html, :name => name, :error => e.to_s)}</div>|.html_safe + %|<div class="flash error">#{::I18n.t(:error_can_not_execute_macro_html, :name => ::ERB::Util.h(name), :error => ::ERB::Util.h(e.to_s))}</div>|.html_safe end end diff --git a/test/unit/lib/redmine/wiki_formatting/macros_test.rb b/test/unit/lib/redmine/wiki_formatting/macros_test.rb index f23c76fdd..a41428266 100644 --- a/test/unit/lib/redmine/wiki_formatting/macros_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/macros_test.rb @@ -140,12 +140,12 @@ class Redmine::WikiFormatting::MacrosTest < Redmine::HelperTest def test_macro_exception_should_be_displayed Redmine::WikiFormatting::Macros.macro :exception do |obj, args| - raise "My message" + raise "My exception's message" end text = "{{exception}}" assert_include( - '<div class="flash error">Error executing the <strong>exception</strong> macro (My message)</div>', + '<div class="flash error">Error executing the <strong>exception</strong> macro (My exception's message)</div>', textilizable(text) ) end |