From 1bcd46b18e91ae14d7362a29df06101e960db1c1 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Mon, 23 Sep 2013 18:42:00 +0200 Subject: [PATCH] query parsing fix --- src/util/urlcode.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/urlcode.lua b/src/util/urlcode.lua index 8a1f373..6aa6921 100644 --- a/src/util/urlcode.lua +++ b/src/util/urlcode.lua @@ -104,11 +104,12 @@ function _M.parsequeryNoRegex (query, args) local v = query:find('=', k+1, true) -- look for '=', assuming a key of at least 1 character and do not perform pattern matching if not v then break end -- no k/v pairs left + local key = query:sub(k, v-1) v = v + 1 local ampersand = query:find('&', v, true) if not ampersand then ampersand = 0 end -- 0 will become -1 in the substring call below...meaning end of string - local key = query:sub(k, v-1) + local value = query:sub(v, ampersand - 1) insertfield (args, unescape(key), unescape(value))