Merged r23519 from trunk to 5.1-stable (#42326).

git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@23526 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2025-03-07 07:45:36 +00:00
parent f5f5d1d4f2
commit 7c668dc21e
2 changed files with 3 additions and 3 deletions

View File

@@ -50,7 +50,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

View File

@@ -142,12 +142,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&#39;s message)</div>',
textilizable(text)
)
end