From e7e5f5d586e4c88873497df418cbc5ef44a3c71c Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 18 Jan 2017 14:41:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=89=E5=A4=9A=E4=B8=AA=E8=B4=A6=E6=88=B7?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E9=80=80=E5=87=BA=E5=86=8D=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=85=B6=E5=AE=83=E8=B4=A6=E6=88=B7=EF=BC=8C?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=BF=9B=E6=9D=A5=E5=8D=B4=E5=A7=8B=E7=BB=88?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E6=98=AF=E4=B8=8A=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E8=B4=A6=E6=88=B7=E7=9A=84=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 33902ccc4..445b20af8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -583,7 +583,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) if default.is_a?(User) + back_url = back_url.gsub(%r{\/users\/(\D+)},"/users/"+default.to_s) if default.is_a?(User) redirect_to(back_url) return end