From 2b7beaeae8c2b0c9cb732d7a6ab798be7877d9ff Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 29 Aug 2015 11:35:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E6=AC=A1=E7=99=BB=E5=BD=95=E7=9A=84?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E7=94=A8=E6=88=B7id=E5=8F=98=E4=B8=BA?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=94=A8=E6=88=B7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 10e5e6f06..698b0de48 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -563,6 +563,7 @@ class ApplicationController < ActionController::Base uri = URI.parse(back_url) # 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)}) + back_url = back_url.gsub(%r{\/users\/(\d+)},"/users/"+default.id.to_s) redirect_to(back_url) return end