X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fweb%2Fluasrc%2Fcbi.lua;h=ef45a89563e38a1921c765407da412063bb46295;hp=88fb8a9b1f3ab6c8bf5c5f97ab570174850d2a18;hb=a4996261eaa0b2057967e5eb855005a3403a6cb0;hpb=9fcdf0fe81f3c5142b8abd3f701dc3964549742a diff --git a/libs/web/luasrc/cbi.lua b/libs/web/luasrc/cbi.lua index 88fb8a9b1..ef45a8956 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] = { } @@ -1432,13 +1432,11 @@ function AbstractValue.validate(self, value) local v for _, v in ipairs(value) do if v and #v > 0 and not verify_datatype(self.datatype, v) then - error('F') return nil end end else if not verify_datatype(self.datatype, value) then - error('F') return nil end end