Skip to content
Browse files

Merge pull request #14016 from devlinzed/i18n_doc_fix

Documentation: Don't symbolize tainted data. [ci skip]
  • Loading branch information...
2 parents b12c1b8 + ec0664a commit 4359bc6a7a6437899cca4ff7f719be8b29f0b6b3 @fxn fxn committed Feb 11, 2014
Showing with 5 additions and 1 deletion.
  1. +5 −1 guides/source/i18n.md
View
6 guides/source/i18n.md
@@ -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
```

0 comments on commit 4359bc6

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