Skip to content

Commit

Permalink
Use only escaped auto_link
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
  • Loading branch information
dzaporozhets committed Oct 6, 2014
1 parent 90c96d1 commit 2991149
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,8 @@ def link_to(name = nil, options = nil, html_options = nil, &block)

super
end

def escaped_autolink(text)
auto_link ERB::Util.html_escape(text), link: :urls
end
end
2 changes: 1 addition & 1 deletion app/views/groups/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
= @group.name
- if @group.description.present?
%p
= auto_link @group.description, link: :urls
= escaped_autolink(@group.description)
= render "projects", projects: @projects
- if current_user
.prepend-top-20
Expand Down
2 changes: 1 addition & 1 deletion app/views/projects/_home_panel.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.project-home-row
.project-home-desc
- if @project.description.present?
= auto_link ERB::Util.html_escape(@project.description), link: :urls
= escaped_autolink(@project.description)
- if can?(current_user, :admin_project, @project)
&ndash;
= link_to 'Edit', edit_project_path
Expand Down

0 comments on commit 2991149

Please sign in to comment.