* Core translation
[project/luci.git] / libs / core / luasrc / util.lua
index 6b474f6..11f7720 100644 (file)
@@ -107,7 +107,7 @@ end
 function dumptable(t, i)
        i = i or 0
        for k,v in pairs(t) do
-               print(string.rep("\t", i) .. k, v)
+               print(string.rep("\t", i) .. tostring(k), tostring(v))
                if type(v) == "table" then
                        dumptable(v, i+1)
                end
@@ -276,20 +276,6 @@ function updfenv(f, extscope)
 end
 
 
--- Validates a variable
-function validate(value, cast_number, cast_int)
-       if cast_number or cast_int then
-               value = tonumber(value)
-       end
-       
-       if cast_int and value and not(value % 1 == 0) then
-               value = nil
-       end
-       
-       return value
-end
-
-
 -- Parse units from a string and return integer value
 function parse_units(ustr)
 
@@ -303,6 +289,7 @@ function parse_units(ustr)
                 w   = 60 * 60 * 24 * 7,
                 d   = 60 * 60 * 24,
                 h   = 60 * 60,
+               min = 60,
 
                 -- storage sizes
                 kb  = 1024,