@@ -2,7 +2,7 @@ module RedmineViewCustomize
22 class ViewHook < Redmine ::Hook ::ViewListener
33 def view_layouts_base_html_head ( context = { } )
44
5- path = context [ :request ] . path_info . force_encoding ( 'UTF-8' ) ;
5+ path = Redmine :: CodesetUtil . replace_invalid_utf8 ( context [ :request ] . path_info ) ;
66
77 html = "\n <!-- [view customize plugin] path:#{ path } -->\n "
88 html << stylesheet_link_tag ( "view_customize" , plugin : "view_customize" )
@@ -17,7 +17,8 @@ def view_layouts_base_html_head(context={})
1717
1818 def view_issues_form_details_bottom ( context = { } )
1919
20- return create_view_customize_html ( context [ :request ] . path_info . force_encoding ( 'UTF-8' ) , ViewCustomize ::INSERTION_POSITION_ISSUE_FORM )
20+ path = Redmine ::CodesetUtil . replace_invalid_utf8 ( context [ :request ] . path_info ) ;
21+ return create_view_customize_html ( path , ViewCustomize ::INSERTION_POSITION_ISSUE_FORM )
2122 end
2223
2324 def view_issues_show_details_bottom ( context = { } )
@@ -26,7 +27,8 @@ def view_issues_show_details_bottom(context={})
2627 html << "ViewCustomize.context.issue = { id: #{ context [ :issue ] . id } };"
2728 html << "\n //]]>\n </script>"
2829
29- html << create_view_customize_html ( context [ :request ] . path_info . force_encoding ( 'UTF-8' ) , ViewCustomize ::INSERTION_POSITION_ISSUE_SHOW )
30+ path = Redmine ::CodesetUtil . replace_invalid_utf8 ( context [ :request ] . path_info ) ;
31+ html << create_view_customize_html ( path , ViewCustomize ::INSERTION_POSITION_ISSUE_SHOW )
3032
3133 return html
3234 end
0 commit comments