SECURITY: Fix XSS on unsubscribed page.

This commit is contained in:
Guo Xiang Tan
2017-10-09 08:59:03 +08:00
parent 4ea87b5ab8
commit 190558db9d
4 changed files with 17 additions and 2 deletions

View File

@ -110,6 +110,7 @@ class EmailController < ApplicationController
def unsubscribed
@email = params[:email]
raise Discourse::NotFound if !User.find_by_email(params[:email])
@topic = Topic.find_by(id: params[:topic_id].to_i) if params[:topic_id]
end