##// END OF EJS Templates
Ruby1.9: skip enforcing UTF-8 encodings on the params hash on Rails2 if it is frozen (#4050, #4796)...
Toshi MARUYAMA -
r8596:d4d27bd2d8b5
parent child
Show More
@@ -54,7 +54,9 class ApplicationController < ActionController::Base
54 end
54 end
55
55
56 def utf8nize!(obj)
56 def utf8nize!(obj)
57 if obj.is_a? String
57 if obj.frozen?
58 obj
59 elsif obj.is_a? String
58 obj.respond_to?(:force_encoding) ? obj.force_encoding("UTF-8") : obj
60 obj.respond_to?(:force_encoding) ? obj.force_encoding("UTF-8") : obj
59 elsif obj.is_a? Hash
61 elsif obj.is_a? Hash
60 obj.each {|k, v| obj[k] = self.utf8nize!(v)}
62 obj.each {|k, v| obj[k] = self.utf8nize!(v)}
General Comments 0
You need to be logged in to leave comments. Login now