]> source.dussan.org Git - sonarqube.git/commitdiff
Protect agains XSS of user name in issue viewer
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Tue, 8 Apr 2014 10:28:34 +0000 (12:28 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Tue, 8 Apr 2014 10:28:34 +0000 (12:28 +0200)
sonar-server/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb

index 7f15477920daf2c8b9695d0c1d1ec73a89a4ccf4..f83a9992c99776f1e7c190d31c24411c34686ea5 100644 (file)
          comment_html_id = "comment-#{comment.key}-#{rand(100)}" %>
       <div class="code-issue-comment" id="<%= comment_html_id -%>" data-comment-key="<%= comment.key -%>">
         <h4>
-          <%= image_tag('reviews/comment.png') -%> &nbsp;<b><%= @issue_results.user(comment.userLogin()).name() -%></b>
+          <%= image_tag('reviews/comment.png') -%> &nbsp;<b><%= h( @issue_results.user(comment.userLogin()).name() ) -%></b>
           (<%= distance_of_time_in_words_to_now(Api::Utils.java_to_ruby_datetime(comment.createdAt)) -%>)
           <% if current_user && current_user.login==comment.userLogin %>
             &nbsp;