Commit 5014b23c authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Fixed: inappropriate redirection to login or register page may occur (#2206).…

Fixed: inappropriate redirection to login or register page may occur (#2206). Eg. user clicks login link twice before logging in.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2062 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent a6b6dc60
......@@ -127,8 +127,8 @@ class ApplicationController < ActionController::Base
back_url = CGI.unescape(params[:back_url].to_s)
if !back_url.blank?
uri = URI.parse(back_url)
# do not redirect user to another host
if uri.relative? || (uri.host == request.host)
# do not redirect user to another host or to the login or register page
if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(login|account/register)})
redirect_to(back_url) and return
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment