Skip to content
This repository
Browse code

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 1 changed file with 1 addition and 5 deletions. Show diff stats Hide diff stats

  1. +1 5 guides/source/i18n.md
6 guides/source/i18n.md
Source Rendered
@@ -145,11 +145,7 @@ The _setting part_ is easy. You can set the locale in a `before_action` in the `
145 145 before_action :set_locale
146 146
147 147 def set_locale
148   - if %w[en fr].include?(params[:locale])
149   - I18n.locale = params[:locale]
150   - else
151   - I18n.locale = I18n.default_locale
152   - end
  148 + I18n.locale = params[:locale] || I18n.default_locale
153 149 end
154 150 ```
155 151

0 comments on commit e00ab2d

Please sign in to comment.
Something went wrong with that request. Please try again.