summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index cbeb40d..d8de975 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -21,13 +21,13 @@ class ApplicationController < ActionController::Base
21 { locale: I18n.locale == I18n.default_locale ? nil : I18n.locale } 21 { locale: I18n.locale == I18n.default_locale ? nil : I18n.locale }
22 end 22 end
23 23
24 def safe_return_to(url) 24 def safe_return_to(url, default: events_path)
25 return events_path if url.blank? 25 return default if url.blank?
26 uri = URI.parse(url) 26 uri = URI.parse(url)
27 return events_path if uri.host.present? 27 return default if uri.host.present?
28 return events_path unless url.start_with?('/') 28 return default unless url.start_with?('/')
29 url 29 url
30 rescue URI::InvalidURIError 30 rescue URI::InvalidURIError
31 events_path 31 default
32 end 32 end
33end 33end