From 02e3add66e147b22e165106ddded93050c918f8c Mon Sep 17 00:00:00 2001 From: dmiller Date: Wed, 28 Mar 2018 20:17:43 +0000 Subject: [PATCH] Fix type comparisons to library names. Closes #1158 --- scripts/http-grep.nse | 2 +- scripts/nbd-info.nse | 2 +- scripts/whois-ip.nse | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/http-grep.nse b/scripts/http-grep.nse index ac5220888..1c5bc56de 100644 --- a/scripts/http-grep.nse +++ b/scripts/http-grep.nse @@ -258,7 +258,7 @@ action = function(host, port) end -- check if match arugment is a table or a single value - if match and type(match) ~= table then + if match and type(match) ~= 'table' then to_be_searched['User Pattern 1'] = {} table.insert(to_be_searched['User Pattern 1'], match) elseif type(match) == 'table' then diff --git a/scripts/nbd-info.nse b/scripts/nbd-info.nse index 6dac155b8..dfc505043 100644 --- a/scripts/nbd-info.nse +++ b/scripts/nbd-info.nse @@ -100,7 +100,7 @@ local function parse_args() -- An empty string for an export name indicates to the server that -- we wish to attach to the default export. arg = {} - elseif type(arg) ~= table then + elseif type(arg) ~= 'table' then arg = {arg} end args.export_name = arg diff --git a/scripts/whois-ip.nse b/scripts/whois-ip.nse index 412cb7689..fc7ac7465 100644 --- a/scripts/whois-ip.nse +++ b/scripts/whois-ip.nse @@ -2223,7 +2223,7 @@ end function get_period( period ) - if type( period ) ~= string or ( period == "" ) then return nil end + if type( period ) ~= 'string' or ( period == "" ) then return nil end local quant, unit = period:match( "(-?+?%d*%.?%d*)([SsMmHhDd]?)" ) if not ( tonumber( quant ) ) then return nil end