Skip to content

Commit

Permalink
Fixed XSS vulnerability in helper method.
Browse files Browse the repository at this point in the history
  • Loading branch information
steveyken committed Sep 2, 2014
1 parent 827bfc9 commit 29a8c83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/helpers/application_helper.rb
Expand Up @@ -413,8 +413,8 @@ def col(title, value, last = false, email = false)
else
fmt_value.gsub(/((http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:\/\+#]*[\w\-\@?^=%&amp;\/\+#])?)/, "<a href=\"\\1\">\\1</a>")
end
%Q^<th#{last ? " class=\"last\"" : ""}>#{title}:</th>
<td#{last ? " class=\"last\"" : ""}>#{fmt_value}</td>^.html_safe
%Q^<th#{last ? " class=\"last\"" : ""}>#{h title}:</th>
<td#{last ? " class=\"last\"" : ""}>#{h fmt_value}</td>^.html_safe
end

#----------------------------------------------------------------------------
Expand Down

0 comments on commit 29a8c83

Please sign in to comment.