Commit 78cfdefbf923417838e5b477b8e4c6b791f5df62

Authored by JoenioCosta
1 parent 7b8823c2

ActionItem192: fixing xss_terminate plugin :only option

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1719 3f533792-8f58-4932-b0fe-aaf55b0a4547
vendor/plugins/xss_terminate/lib/xss_terminate.rb
... ... @@ -56,7 +56,7 @@ module XssTerminate
56 56 columns_serialized = self.class.serialized_attributes.keys
57 57  
58 58 if !xss_terminate_options[:only].empty?
59   - columns.select{ |i| xss_terminate_options[:only].include?( i ) }
  59 + columns = columns.select{ |i| xss_terminate_options[:only].include?( i.to_sym ) }
60 60 elsif !xss_terminate_options[:except].empty?
61 61 columns.delete_if{ |i| xss_terminate_options[:except].include?( i.to_sym ) }
62 62 end
... ... @@ -67,7 +67,7 @@ module XssTerminate
67 67 next unless self[field]
68 68 self[field].each_key { |key|
69 69 key = key.to_sym
70   - self[field][key] = xss_terminate_options[:sanitizer].sanitize(self[field][key].to_s)
  70 + self[field][key] = xss_terminate_options[:sanitizer].sanitize(self[field][key])
71 71 }
72 72 else
73 73 self[field] = xss_terminate_options[:sanitizer].sanitize(self[field])
... ...