lib/ronin/exploits/sqli.rb in ronin-exploits-1.0.0 vs lib/ronin/exploits/sqli.rb in ronin-exploits-1.0.1

- old
+ new

@@ -1,5 +1,6 @@ +# frozen_string_literal: true # # ronin-exploits - A Ruby library for ronin-rb that provides exploitation and # payload crafting functionality. # # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com) @@ -32,21 +33,21 @@ # [SQLI]: https://owasp.org/www-community/attacks/SQL_Injection # # ## Example # # require 'ronin/exploits/sqli' - # + # # module Ronin # module Exploits # class MyExploit < SQLI - # + # # register 'my_exploit' - # + # # base_path '/path/to/page.php' # query_param 'id' # escape_quote true - # + # # end # end # end # # @api public @@ -85,14 +86,14 @@ # # @return [Boolean] # Specifies whether to escape quotation marks. # def self.escape_quote(new_escape_quote=nil) - if new_escape_quote != nil + if !new_escape_quote.nil? @escape_quote = new_escape_quote else - if @escape_quote != nil + if !@escape_quote.nil? @escape_quote elsif superclass < SQLI superclass.escape_quote else false @@ -108,14 +109,14 @@ # # @return [Boolean] # Specifies whether to escape parenthesis. # def self.escape_parens(new_escape_parens=nil) - if new_escape_parens != nil + if !new_escape_parens.nil? @escape_parens = new_escape_parens else - if @escape_parens != nil + if !@escape_parens.nil? @escape_parens elsif superclass < SQLI superclass.escape_parens else false @@ -131,13 +132,13 @@ # # @return [Boolean] # Specifies whether to terminate the injected SQL expression. # def self.terminate(new_terminate=nil) - if new_terminate != nil + if !new_terminate.nil? @terminate = new_terminate else - if @terminate != nil + if !@terminate.nil? @terminate elsif superclass < SQLI superclass.terminate else false