Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Don't symbolize tainted data." [ci skip]

Reason: i18n whitelists now locales without passing through symbols,
see https://github.com/svenfuchs/i18n/blob/master/lib/i18n.rb#L278.
Therefore, this snippet is no longer a good practice.

This reverts commit ec0664a.
  • Loading branch information...
commit e00ab2dab9671603dcc8ab571baf1b1df100f99b 1 parent 4359bc6
Xavier Noria fxn authored
Showing with 1 addition and 5 deletions.
  1. +1 −5 guides/source/i18n.md
6 guides/source/i18n.md
View
@@ -145,11 +145,7 @@ The _setting part_ is easy. You can set the locale in a `before_action` in the `
before_action :set_locale
def set_locale
- if %w[en fr].include?(params[:locale])
- I18n.locale = params[:locale]
- else
- I18n.locale = I18n.default_locale
- end
+ I18n.locale = params[:locale] || I18n.default_locale
end
```
Please sign in to comment.
Something went wrong with that request. Please try again.