diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-11-25 20:28:56 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-11-25 20:28:56 +0000 |
commit | ebab5a00744c32dbfb3c1bfff82583287f49b914 (patch) | |
tree | 626ca2293d73c0be7800941910aec11bac7c5cf5 | |
parent | b75e0382557ad89069f03807d423338d906fa485 (diff) | |
download | redmine-ebab5a00744c32dbfb3c1bfff82583287f49b914.tar.gz redmine-ebab5a00744c32dbfb3c1bfff82583287f49b914.zip |
Remove broken cookies after upgrade from 0.8.x to prevent an error from Rails (#4292).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3093 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/application_controller.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1f8967956..071d48ef0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -23,6 +23,17 @@ class ApplicationController < ActionController::Base layout 'base' + # Remove broken cookie after upgrade from 0.8.x (#4292) + # See https://rails.lighthouseapp.com/projects/8994/tickets/3360 + # TODO: remove it when Rails is fixed + before_filter :delete_broken_cookies + def delete_broken_cookies + if cookies['_redmine_session'] && cookies['_redmine_session'] !~ /--/ + cookies.delete '_redmine_session' + redirect_to home_path and return false + end + end + before_filter :user_setup, :check_if_login_required, :set_localization filter_parameter_logging :password protect_from_forgery @@ -34,7 +45,7 @@ class ApplicationController < ActionController::Base REDMINE_SUPPORTED_SCM.each do |scm| require_dependency "repository/#{scm.underscore}" end - + def user_setup # Check the settings cache for each request Setting.check_cache |