Project

General

Profile

Defect #41721 » 0001-Fixed-double-escaping-issue-for-a-principal-name-with-special-chars.patch

Katsuya HIDAKA, 2024-11-09 16:18

View differences:

app/helpers/application_helper.rb
60 60
    only_path = options[:only_path].nil? ? true : options[:only_path]
61 61
    case principal
62 62
    when User
63
      name = h(principal.name(options[:format]))
64
      name = "@".html_safe + name if options[:mention]
63
      name = principal.name(options[:format])
64
      name = "@#{name}" if options[:mention]
65 65
      css_classes = ''
66 66
      if principal.active? || (User.current.admin? && principal.logged?)
67 67
        url = user_url(principal, :only_path => only_path)
68 68
        css_classes += principal.css_classes
69 69
      end
70 70
    when Group
71
      name = h(principal.to_s)
71
      name = principal.to_s
72 72
      url = group_url(principal, :only_path => only_path)
73 73
      css_classes = principal.css_classes
74 74
    else
75
      name = h(principal.to_s)
75
      name = principal.to_s
76 76
    end
77 77

  
78 78
    css_classes += " #{options[:class]}" if css_classes && options[:class].present?
79
    url ? link_to(principal_icon(principal.class.name.downcase).to_s + name, url, :class => css_classes) : name
79
    url ? link_to(principal_icon(principal.class.name.downcase).to_s + name, url, :class => css_classes) : h(name)
80 80
  end
81 81

  
82 82
  # Displays a link to edit group page if current user is admin
(3-3/4)