1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-31 11:37:14 +00:00

Fix invalid "theme-*" CSS class in body element when theme name contains spaces (#26778).

Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23144 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2024-10-19 08:21:18 +00:00
parent f1ae3eea67
commit ffb78c12c3
2 changed files with 9 additions and 1 deletions

View File

@ -863,7 +863,7 @@ module ApplicationHelper
def body_css_classes
css = []
if theme = Redmine::Themes.theme(Setting.ui_theme)
css << 'theme-' + theme.name
css << 'theme-' + theme.name.tr(' ', '_')
end
css << 'project-' + @project.identifier if @project && @project.identifier.present?

View File

@ -101,4 +101,12 @@ class ThemesTest < Redmine::IntegrationTest
ensure
Redmine::Utils.relative_url_root = ''
end
def test_body_css_class_with_spaces_in_theme_name
@theme.instance_variable_set(:@name, 'Foo bar baz')
get '/'
assert_response :success
assert_select 'body[class~="theme-Foo_bar_baz"]'
end
end