Merge pull request #14016 from devlinzed/i18n_doc_fix
Documentation: Don't symbolize tainted data. [ci skip]
This commit is contained in:
commit
4359bc6a7a
@ -145,7 +145,11 @@ The _setting part_ is easy. You can set the locale in a `before_action` in the `
|
||||
before_action :set_locale
|
||||
|
||||
def set_locale
|
||||
I18n.locale = params[:locale] || I18n.default_locale
|
||||
if %w[en fr].include?(params[:locale])
|
||||
I18n.locale = params[:locale]
|
||||
else
|
||||
I18n.locale = I18n.default_locale
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user