X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=libs%2Fuvl%2Fluasrc%2Fuvl.lua;h=361cfc410fb0d0bb0fe238f4e7d924cb231fbf49;hb=e5608ae6b2896b5ad7d9d7c8f73b6ec1efaaddcf;hp=afa3cc71701aa7baba06ee39f53229a54c9406db;hpb=50a1f999ce977684e71c2f5f641c8761c80ac731;p=project%2Fluci.git diff --git a/libs/uvl/luasrc/uvl.lua b/libs/uvl/luasrc/uvl.lua index afa3cc717..361cfc410 100644 --- a/libs/uvl/luasrc/uvl.lua +++ b/libs/uvl/luasrc/uvl.lua @@ -305,11 +305,15 @@ function UVL._validate_option( self, option, nodeps ) if item.datatype and val then if self.datatypes[item.datatype] then - if not self.datatypes[item.datatype]( val ) then - return false, 'Value "' .. ( val or '' ) .. - '" of given option "' .. option:cid() .. - '" does not validate as datatype "' .. - item.datatype .. '"' + val = ( type(val) == "table" and val or { val } ) + for i, v in ipairs(val) do + if not self.datatypes[item.datatype]( v ) then + return false, 'Value' .. ( #val>1 and ' #'..i or '' ) .. + ' "' .. ( v or '' ) .. + '" of given option "' .. option:cid() .. + '" does not validate as datatype "' .. + item.datatype .. '"' + end end else return false, 'Unknown datatype "' ..