class Sanitize::CSS

def valid_image?(node)

only strings that use an allowlisted protocol.
Returns `true` if the given node is an image-related function and contains
def valid_image?(node)
  return false unless node[:node] == :function
  return false unless node.key?(:name) && image_function?(node[:name].downcase)
  return false unless Array === node[:value]
  node[:value].each do |token|
    return false unless Hash === token
    case token[:node]
    when :string
      if token[:value] =~ Sanitize::REGEX_PROTOCOL
        return false unless @config[:protocols].include?($1.downcase)
      else
        return false unless @config[:protocols].include?(:relative)
      end
    else
      next
    end
  end
end