Permalink
Browse files

Applied changes caused by the security fix in spree 1.2.4.

  • Loading branch information...
1 parent ae717e9 commit d32064d832655490513538483c74072843a2578b @fmfdias fmfdias committed Feb 15, 2013
@@ -4,13 +4,13 @@
def locale_suffix(locale)
locale ||= I18n.locale
- I18n.locale == locale.to_sym ? "".to_sym : "_"+ locale
+ I18n.locale == locale ? "" : "_"+ locale
end
private
def set_user_language
- I18n.locale = Rails.application.config.i18n.default_locale.to_sym
+ I18n.locale = Rails.application.config.i18n.default_locale
end
end
@@ -12,7 +12,7 @@
# or Rails.application.config.i18n.default_locale
def set_user_language
locale = params[:locale] || session[:locale] || I18n.locale || Spree::Config[:default_locale] || Rails.application.config.i18n.default_locale
- locale = I18n.default_locale unless locale && I18n.available_locales.include?(locale.to_sym)
- I18n.locale = locale.to_sym
+ locale = I18n.default_locale unless locale && I18n.available_locales.map(&:to_s).include?(locale)
+ I18n.locale = locale
end
end
@@ -5,8 +5,8 @@ def set
session['user_return_to'] = request.referer
end
- if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym)
- session[:locale] = I18n.locale = params[:locale].to_sym
+ if params[:locale] && I18n.available_locales.map(&:to_s).include?(params[:locale])
+ session[:locale] = I18n.locale = params[:locale]
flash.notice = t(:locale_changed)
else
flash[:error] = t(:locale_not_changed)

0 comments on commit d32064d

Please sign in to comment.