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 - %|
#{::I18n.t(:error_can_not_execute_macro_html, :name => name, :error => e.to_s)}
|.html_safe + %|
#{::I18n.t(:error_can_not_execute_macro_html, :name => ::ERB::Util.h(name), :error => ::ERB::Util.h(e.to_s))}
|.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( - '
Error executing the exception macro (My message)
', + '
Error executing the exception macro (My exception's message)
', textilizable(text) ) end