From: Jo-Philipp Wich Date: Sun, 8 Jan 2012 23:36:35 +0000 (+0000) Subject: libs/web: allow zero-length string literals when parsing datatypes X-Git-Tag: 0.11.0~1183 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=875baa244a7bcc147fe16d8b9242a19f13bafe11 libs/web: allow zero-length string literals when parsing datatypes --- diff --git a/libs/web/luasrc/cbi.lua b/libs/web/luasrc/cbi.lua index 88fb8a9b1..e885e4e28 100644 --- a/libs/web/luasrc/cbi.lua +++ b/libs/web/luasrc/cbi.lua @@ -180,8 +180,8 @@ function compile_datatype(code) if #label > 0 and tonumber(label) then stack[#stack+1] = tonumber(label) - elseif label:match("^'.+'$") or label:match('^".+"$') then - stack[#stack+1] = label:gsub("[\"'](.+)[\"']", "%1") + elseif label:match("^'.*'$") or label:match('^".*"$') then + stack[#stack+1] = label:gsub("[\"'](.*)[\"']", "%1") elseif type(datatypes[label]) == "function" then stack[#stack+1] = datatypes[label] stack[#stack+1] = { }