instance method
process_attributes_for
Ruby on Rails 3.1.12
Since v2.2.3 Last seen in v4.1.16Signature
process_attributes_for(node, options)
No documentation comment.
Parameters
-
nodereq -
optionsreq
Source
# File actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 159
def process_attributes_for(node, options)
return unless node.attributes
node.attributes.keys.each do |attr_name|
value = node.attributes[attr_name].to_s
if !options[:attributes].include?(attr_name) || contains_bad_protocols?(attr_name, value)
node.attributes.delete(attr_name)
else
node.attributes[attr_name] = attr_name == 'style' ? sanitize_css(value) : CGI::escapeHTML(CGI::unescapeHTML(value))
end
end
end
Defined in actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb line 159
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in HTML::WhiteListSanitizer