summaryrefslogtreecommitdiffstats
path: root/lib/validator.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/validator.lua')
-rwxr-xr-xlib/validator.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/validator.lua b/lib/validator.lua
index 06c58fc..d57ca5f 100755
--- a/lib/validator.lua
+++ b/lib/validator.lua
@@ -71,7 +71,7 @@ end
--
function is_ipv4(ipv4)
local retval = false;
- local nums = { "", "", "", ""};
+ local nums = {};
local iplen = string.len(ipv4);
-- check the ipv4's length
@@ -82,11 +82,11 @@ function is_ipv4(ipv4)
-- NC: Split the string into an array. separate with '.' (dots)
-- ^ beginning of string
-- () capture
- -- \. litteral '.' The \ neutralizes the . character class.
+ -- %. litteral '.' The % neutralizes the . character class.
-- %d+ one or more digits
-- $ end of string
- nums = { ipv4:match ("^(%d+)\.(%d+)\.(%d+)\.(%d+)$" ) }
-
+ nums = {ipv4:match ("^(%d+)%.(%d+)%.(%d+)%.(%d+)$")}
+
-- check if all nums are filled
if ( nums[1] == nil or
nums[2] == nil or