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