Skip to content
This repository
Browse code

Applied changes caused by the security fix in spree 1.2.4.

  • Loading branch information...
commit d32064d832655490513538483c74072843a2578b 1 parent ae717e9
Filipe Dias authored February 15, 2013
4  app/controllers/admin/base_controller_decorator.rb
@@ -4,13 +4,13 @@
4 4
 
5 5
   def locale_suffix(locale)
6 6
     locale ||= I18n.locale
7  
-    I18n.locale == locale.to_sym ? "".to_sym : "_"+ locale
  7
+    I18n.locale == locale ? "" : "_"+ locale
8 8
   end
9 9
 
10 10
   private
11 11
 
12 12
   def set_user_language
13  
-    I18n.locale = Rails.application.config.i18n.default_locale.to_sym
  13
+    I18n.locale = Rails.application.config.i18n.default_locale
14 14
   end
15 15
 
16 16
 end
4  app/controllers/controller_helpers_decorator.rb
@@ -12,7 +12,7 @@
12 12
   # or Rails.application.config.i18n.default_locale
13 13
   def set_user_language
14 14
     locale = params[:locale] || session[:locale] || I18n.locale || Spree::Config[:default_locale] || Rails.application.config.i18n.default_locale
15  
-    locale = I18n.default_locale unless locale && I18n.available_locales.include?(locale.to_sym)
16  
-    I18n.locale = locale.to_sym
  15
+    locale = I18n.default_locale unless locale && I18n.available_locales.map(&:to_s).include?(locale)
  16
+    I18n.locale = locale
17 17
   end
18 18
 end
4  app/controllers/locale_controller_decorator.rb
@@ -5,8 +5,8 @@ def set
5 5
         session['user_return_to'] = request.referer
6 6
       end
7 7
 
8  
-      if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym)
9  
-        session[:locale] = I18n.locale = params[:locale].to_sym
  8
+      if params[:locale] && I18n.available_locales.map(&:to_s).include?(params[:locale])
  9
+        session[:locale] = I18n.locale = params[:locale]
10 10
         flash.notice = t(:locale_changed)
11 11
       else
12 12
         flash[:error] = t(:locale_not_changed)

0 notes on commit d32064d

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