summaryrefslogtreecommitdiffhomepage
path: root/src/ffluci/util.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-03-24 21:50:48 +0000
committerSteven Barth <steven@midlink.org>2008-03-24 21:50:48 +0000
commit9fa7e0e92ddae9ff68f50ad20bbdfc8a3c09135a (patch)
treef1d316abaaced25c6d8476e65ad6d50f57013768 /src/ffluci/util.lua
parent8e7ed0e8a752bc3f551aabcf2a20807b64e707ed (diff)
* CBI: updates
* UCI: fixed argument escaping
Diffstat (limited to 'src/ffluci/util.lua')
-rw-r--r--src/ffluci/util.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ffluci/util.lua b/src/ffluci/util.lua
index 38f33a20d4..caa8e41de3 100644
--- a/src/ffluci/util.lua
+++ b/src/ffluci/util.lua
@@ -156,12 +156,12 @@ end
-- Validates a variable
-function validate(value, cast_number, cast_int, valid)
+function validate(value, valid, cast_number, cast_int)
if cast_number or cast_int then
value = tonumber(value)
end
- if cast_int and not(value % 1 == 0) then
+ if cast_int and value and not(value % 1 == 0) then
value = nil
end