From 2c5351389d2134d23a72bbfebe5051f442e49a81 Mon Sep 17 00:00:00 2001 From: Godwin Date: Tue, 9 Aug 2016 17:20:52 -0700 Subject: [PATCH] Fix for empty referrer in production --- 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 fd4d198..143641a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -338,7 +338,7 @@ class ApplicationController < LinguaFrancaApplicationController end # generate the confirmation, send the email and show the 403 - referrer = params[:dest] || request.referer.gsub(/^.*?\/\/.*?\//, '/') + referrer = params[:dest] || (request.present? && request.referer.present? ? request.referer.gsub(/^.*?\/\/.*?\//, '/') : settings_path) generate_confirmation(params[:email], referrer) template = 'login_confirmation_sent' @page_title ||= 'page_titles.403.Please_Check_Email'