Feature #4050 » application_controller.diff
| app/controllers/application_controller.rb | ||
|---|---|---|
|
return false
|
||
|
end
|
||
|
end
|
||
|
before_filter :params_filter
|
||
|
def params_filter
|
||
|
if RUBY_VERSION >= '1.9'
|
||
|
self.utf8nize(params)
|
||
|
end
|
||
|
end
|
||
|
def utf8nize(obj)
|
||
|
if obj.is_a? String
|
||
|
if obj.respond_to?(:force_encoding)
|
||
|
obj.force_encoding("UTF-8")
|
||
|
else
|
||
|
obj
|
||
|
end
|
||
|
elsif obj.is_a? Hash
|
||
|
obj.each {|key, val|
|
||
|
obj[key] = self.utf8nize(val)
|
||
|
}
|
||
|
elsif obj.is_a? Array
|
||
|
obj.map {|val| self.utf8nize(val)}
|
||
|
else
|
||
|
obj
|
||
|
end
|
||
|
end
|
||
|
|
||
|
before_filter :user_setup, :check_if_login_required, :set_localization
|
||
|
filter_parameter_logging :password
|
||