diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2018-03-18 15:52:02 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2018-06-06 14:25:06 +0100 |
commit | ea97a4d4d23962350c8d025a814af828f2efe5ba (patch) | |
tree | df88834c990ac00fa7d1b0e0d4164c0a7496ca3c | |
parent | 3220eae2a47588134767b9c374e2e9d024139e04 (diff) | |
download | gitano-ea97a4d4d23962350c8d025a814af828f2efe5ba.tar.gz |
LACE: Correct a bug in iterating table form values
When a tabular value is given to Lace, we assume that it is in 'set'
form (i.e. the keys are the important thing to match against) and
as such, we need to ensure we skip non-string keys since tables might
be dual form (set, and list).
-rw-r--r-- | lib/gitano/lace.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitano/lace.lua b/lib/gitano/lace.lua index 685d625..77cae64 100644 --- a/lib/gitano/lace.lua +++ b/lib/gitano/lace.lua @@ -137,7 +137,10 @@ local function _do_simple_match(ctx, key, matchtype, value) else local ret = false for k in pairs(kk) do - ret = ret or check(value, k) + -- Only bother if the key is a string (set-form) + if type(k) == "string" then + ret = ret or check(value, k) + end end if matchtype:sub(1,1) == "!" then ret = not ret |