Skip to content

Commit

Permalink
Check that the reactions set_from_email redirect_url is legit
Browse files Browse the repository at this point in the history
  • Loading branch information
issyl0 committed Jul 20, 2023
1 parent 662b9e3 commit 1dd548e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/reactions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def find_or_initialize_reaction
end

def redirect_url
params[:redirect_url].presence || course_lesson_path(@reaction.course_slug, @reaction.lesson_slug)
if params[:redirect_url].present? && params[:redirect_url].starts_with?("https://soulmedicine.io/")

Check failure on line 34 in app/controllers/reactions_controller.rb

View workflow job for this annotation

GitHub Actions / Ruby Linting

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals)
params[:redirect_url]
else
course_lesson_path(@reaction.course_slug, @reaction.lesson_slug)
end
end
end

0 comments on commit 1dd548e

Please sign in to comment.