Skip to content

Commit

Permalink
Use instance variable instead of param
Browse files Browse the repository at this point in the history
Prevent unescaped user input.

Co-authored-by: Eduardo Navarro <enavarro@suse.com>
Co-authored-by: Henne Vogelsang <hvogel@opensuse.org>
  • Loading branch information
3 people committed Jul 9, 2020
1 parent d480d42 commit 2a52e0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def index
@notifications = fetch_notifications
@projects_for_filter = projects_for_filter
@notifications_count = notifications_count
@filtered_project = Project.find_by(name: params[:project])
end

def update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.card.mb-3
%strong.d-block.d-md-none.p-3{ data: { toggle: 'collapse', target: '#filters' },
aria: { expanded: true, controls: 'filters' } }
Filtered by: #{params[:type]&.humanize || params[:project] || 'Unread'}
Filtered by: #{params[:type]&.humanize || @filtered_project || 'Unread'}
%i.float-right.mt-1.fa.fa-chevron-down
.card-body.collapse#filters
= render partial: 'notifications_filter', locals: { projects_for_filter: @projects_for_filter, notifications_count: @notifications_count }
Expand Down

0 comments on commit 2a52e0e

Please sign in to comment.