Sha256: e9fbececb5ead50e8bb3894baa4770a5e8eb1aa86393f6e09cb5e56b6898b3df

Contents?: true

Size: 1.33 KB

Versions: 2

Compression:

Stored size: 1.33 KB

Contents

=begin
    Copyright 2010-2017 Sarosys LLC <http://www.sarosys.com>

    This file is part of the Arachni Framework project and is subject to
    redistribution and commercial restrictions. Please see the Arachni Framework
    web site for more information on licensing and terms of use.
=end

module Arachni::Element
class LinkTemplate
module Capabilities

# Extends {Arachni::Element::Capabilities::Inputtable} with {LinkTemplate}-specific
# functionality.
#
# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
module Inputtable
    include Arachni::Element::Capabilities::Inputtable

    INVALID_INPUT_DATA = [
        # Protocol URLs require a // which we can't preserve.
        '://'
    ]

    # @param    [String]    name
    #   Input name.
    #
    # @return   [Bool]
    #   `true` if the `name` can be found as a named capture in {#template},
    #   `false` otherwise.
    def valid_input_name?( name )
        return if !@template
        @template.names.include? name
    end

    # @param    [String]    data
    #   Input data.
    #
    # @return   [Bool]
    #   `true` if the `data` don't contain strings specified in
    #   #{INVALID_INPUT_DATA}, `false` otherwise.
    #
    # @see INVALID_INPUT_DATA
    def valid_input_data?( data )
        !INVALID_INPUT_DATA.find { |c| data.include? c }
    end

end

end
end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
arachni-1.5.1 lib/arachni/element/link_template/capabilities/inputtable.rb
arachni-1.5 lib/arachni/element/link_template/capabilities/inputtable.rb