restrict ToS url redirect to local urls; see #1813

This commit is contained in:
Toks
2013-06-30 11:17:19 -04:00
parent 0dff962d9e
commit 513122c480

View File

@@ -4,7 +4,8 @@ class StaticController < ApplicationController
def accept_terms_of_service
cookies.permanent[:accepted_tos] = "1"
redirect_to(params[:url] || posts_path)
url = params[:url] if params[:url].start_with? '/'
redirect_to(url || posts_path)
end
def error