提交 e00ab2da 编写于 作者: X Xavier Noria

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 ec0664a6.
上级 4359bc6a
......@@ -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
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册