diff options
| author | hukl <contact@smyck.org> | 2010-01-31 21:18:22 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2010-01-31 21:18:22 +0100 |
| commit | a6c90c54431c11064e09c760e946cf98f55d6863 (patch) | |
| tree | 8f5405a7525451fcef0b5338b1f2540fc79dc62f /app/controllers/application_controller.rb | |
| parent | 68d77e6afef4cbadb798229ecbb7e7392dcf44e4 (diff) | |
sanitize weird locales
Diffstat (limited to 'app/controllers/application_controller.rb')
| -rw-r--r-- | app/controllers/application_controller.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 275a4d4..779193f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb | |||
| @@ -17,6 +17,10 @@ class ApplicationController < ActionController::Base | |||
| 17 | protected | 17 | protected |
| 18 | 18 | ||
| 19 | def set_locale | 19 | def set_locale |
| 20 | I18n.locale = params[:locale].to_sym if params[:locale] | 20 | if params[:locale] && I18n.available_locales.include?(params[:locale]) |
| 21 | I18n.locale = params[:locale].to_sym | ||
| 22 | else | ||
| 23 | params.delete(:locale) | ||
| 24 | end | ||
| 21 | end | 25 | end |
| 22 | end | 26 | end |
