From: Jo-Philipp Wich Date: Wed, 10 Jun 2015 08:20:49 +0000 (+0200) Subject: Merge pull request #402 from NeoRaider/json-empty-object X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=edf0f4f549983f93ee13223cf614393e7809cf49;hp=304eec2ebaf983fd067e5ae719f8ec023aad8b30 Merge pull request #402 from NeoRaider/json-empty-object luci-lib-json: ignore null keys to allow encoding empty objects --- diff --git a/applications/luci-app-privoxy/Makefile b/applications/luci-app-privoxy/Makefile index bc2c57ee9..3d87a417f 100644 --- a/applications/luci-app-privoxy/Makefile +++ b/applications/luci-app-privoxy/Makefile @@ -10,7 +10,7 @@ PKG_NAME:=luci-app-privoxy # Version == major.minor.patch # increase "minor" on new functionality and "patch" on patches/optimization -PKG_VERSION:=1.0.3 +PKG_VERSION:=1.0.4 # Release == build # increase on changes of translation files diff --git a/applications/luci-app-privoxy/luasrc/controller/privoxy.lua b/applications/luci-app-privoxy/luasrc/controller/privoxy.lua old mode 100755 new mode 100644 index 9ffc404ce..58ba80724 --- a/applications/luci-app-privoxy/luasrc/controller/privoxy.lua +++ b/applications/luci-app-privoxy/luasrc/controller/privoxy.lua @@ -72,8 +72,7 @@ end -- compare versions using "<=" "<" ">" ">=" "=" "<<" ">>" function ipkg_ver_compare(ver1, comp, ver2) - if not ver1 or not (#ver1 > 0) - or not ver2 or not (#ver2 > 0) + if not ver1 or not ver2 or not comp or not (#comp > 0) then return nil end -- correct compare string if comp == "<>" or comp == "><" or comp == "!=" or comp == "~=" then comp = "~=" @@ -90,33 +89,19 @@ function ipkg_ver_compare(ver1, comp, ver2) for i = 1, math.max(table.getn(av1),table.getn(av2)), 1 do local s1 = av1[i] or "" local s2 = av2[i] or "" - local n1 = tonumber(s1) - local n2 = tonumber(s2) - - -- one numeric and other empty string then set other to 0 - if n1 and not n2 and (not s2 or #s2 == 0) then n2 = 0 end - if n2 and not n1 and (not s1 or #s1 == 0) then n1 = 0 end - - local nc = (n1 and n2) -- numeric compare - - if nc then - -- first "not equal" found return true - if comp == "~=" and (n1 ~= n2) then return true end - -- first "lower" found return true - if (comp == "<" or comp == "<=") and (n1 < n2) then return true end - -- first "greater" found return true - if (comp == ">" or comp == ">=") and (n1 > n2) then return true end - -- not equal then return false - if (n1 ~= n2) then return false end - else - if comp == "~=" and (s1 ~= s2) then return true end - if (comp == "<" or comp == "<=") and (s1 < s2) then return true end - if (comp == ">" or comp == ">=") and (s1 > s2) then return true end - if (s1 ~= s2) then return false end - end + + -- first "not equal" found return true + if comp == "~=" and (s1 ~= s2) then return true end + -- first "lower" found return true + if (comp == "<" or comp == "<=") and (s1 < s2) then return true end + -- first "greater" found return true + if (comp == ">" or comp == ">=") and (s1 > s2) then return true end + -- not equal then return false + if (s1 ~= s2) then return false end end - -- all equal then true - return true + + -- all equal and not compare greater or lower then true + return not (comp == "<" or comp == ">") end -- read version information for given package if installed diff --git a/applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua b/applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua old mode 100755 new mode 100644 index c009313e3..c415f8e06 --- a/applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua +++ b/applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua @@ -39,6 +39,7 @@ if not nixio.fs.access("/etc/config/privoxy") or not VEROK then local f = SimpleForm("_no_config") f.title = TITLE f.description = DESC + f.embedded = true f.submit = false f.reset = false diff --git a/applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm b/applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm old mode 100755 new mode 100644 diff --git a/applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua b/applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua index 99a884f86..a8ea57e31 100644 --- a/applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua +++ b/applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua @@ -53,25 +53,6 @@ dsth.rmempty = true dsth:value("", translate("all")) wa.cbi_add_knownips(dsth) -l7 = s:option(ListValue, "layer7", translate("Service")) -l7.rmempty = true -l7:value("", translate("all")) - -local pats = io.popen("find /etc/l7-protocols/ -type f -name '*.pat'") -if pats then - local l - while true do - l = pats:read("*l") - if not l then break end - - l = l:match("([^/]+)%.pat$") - if l then - l7:value(l) - end - end - pats:close() -end - p = s:option(Value, "proto", translate("Protocol")) p:value("", translate("all")) p:value("tcp", "TCP") diff --git a/applications/luci-app-radicale/Makefile b/applications/luci-app-radicale/Makefile index 07998aee5..960618dba 100644 --- a/applications/luci-app-radicale/Makefile +++ b/applications/luci-app-radicale/Makefile @@ -10,7 +10,7 @@ PKG_NAME:=luci-app-radicale # Version == major.minor.patch # increase "minor" on new functionality and "patch" on patches/optimization -PKG_VERSION:=1.0.0 +PKG_VERSION:=1.0.1 # Release == build # increase on changes of translation files diff --git a/applications/luci-app-radicale/luasrc/controller/radicale.lua b/applications/luci-app-radicale/luasrc/controller/radicale.lua old mode 100755 new mode 100644 index 662c60d5a..d384b00d9 --- a/applications/luci-app-radicale/luasrc/controller/radicale.lua +++ b/applications/luci-app-radicale/luasrc/controller/radicale.lua @@ -122,8 +122,7 @@ end -- compare versions using "<=" "<" ">" ">=" "=" "<<" ">>" function ipkg_ver_compare(ver1, comp, ver2) - if not ver1 or not (#ver1 > 0) - or not ver2 or not (#ver2 > 0) + if not ver1 or not ver2 or not comp or not (#comp > 0) then return nil end -- correct compare string if comp == "<>" or comp == "><" or comp == "!=" or comp == "~=" then comp = "~=" @@ -140,33 +139,19 @@ function ipkg_ver_compare(ver1, comp, ver2) for i = 1, math.max(table.getn(av1),table.getn(av2)), 1 do local s1 = av1[i] or "" local s2 = av2[i] or "" - local n1 = tonumber(s1) - local n2 = tonumber(s2) - - -- one numeric and other empty string then set other to 0 - if n1 and not n2 and (not s2 or #s2 == 0) then n2 = 0 end - if n2 and not n1 and (not s1 or #s1 == 0) then n1 = 0 end - - local nc = (n1 and n2) -- numeric compare - - if nc then - -- first "not equal" found return true - if comp == "~=" and (n1 ~= n2) then return true end - -- first "lower" found return true - if (comp == "<" or comp == "<=") and (n1 < n2) then return true end - -- first "greater" found return true - if (comp == ">" or comp == ">=") and (n1 > n2) then return true end - -- not equal then return false - if (n1 ~= n2) then return false end - else - if comp == "~=" and (s1 ~= s2) then return true end - if (comp == "<" or comp == "<=") and (s1 < s2) then return true end - if (comp == ">" or comp == ">=") and (s1 > s2) then return true end - if (s1 ~= s2) then return false end - end + + -- first "not equal" found return true + if comp == "~=" and (s1 ~= s2) then return true end + -- first "lower" found return true + if (comp == "<" or comp == "<=") and (s1 < s2) then return true end + -- first "greater" found return true + if (comp == ">" or comp == ">=") and (s1 > s2) then return true end + -- not equal then return false + if (s1 ~= s2) then return false end end - -- all equal then true - return true + + -- all equal and not compare greater or lower then true + return not (comp == "<" or comp == ">") end -- read version information for given package if installed diff --git a/applications/luci-app-radicale/luasrc/model/cbi/radicale.lua b/applications/luci-app-radicale/luasrc/model/cbi/radicale.lua old mode 100755 new mode 100644 diff --git a/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua b/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua index 148bdcbfc..b604f6b65 100644 --- a/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua +++ b/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua @@ -15,7 +15,7 @@ TZ = { { 'Africa/Blantyre', 'CAT-2' }, { 'Africa/Brazzaville', 'WAT-1' }, { 'Africa/Bujumbura', 'CAT-2' }, - { 'Africa/Cairo', 'EET-2EEST,M4.5.4/24,M9.5.4/24' }, + { 'Africa/Cairo', 'EET-2' }, { 'Africa/Casablanca', 'WET0WEST,M3.5.0,M10.5.0/3' }, { 'Africa/Ceuta', 'CET-1CEST,M3.5.0,M10.5.0/3' }, { 'Africa/Conakry', 'GMT0' }, @@ -55,7 +55,7 @@ TZ = { { 'Africa/Tripoli', 'EET-2' }, { 'Africa/Tunis', 'CET-1' }, { 'Africa/Windhoek', 'WAT-1WAST,M9.1.0,M4.1.0' }, - { 'America/Adak', 'HAST10HADT,M3.2.0,M11.1.0' }, + { 'America/Adak', 'HST10HDT,M3.2.0,M11.1.0' }, { 'America/Anchorage', 'AKST9AKDT,M3.2.0,M11.1.0' }, { 'America/Anguilla', 'AST4' }, { 'America/Antigua', 'AST4' }, diff --git a/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua b/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua index fe3f86097..24429ac36 100644 --- a/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua +++ b/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua @@ -9,11 +9,10 @@ OFFSET = { wat = 3600, -- WAT cat = 7200, -- CAT eet = 7200, -- EET - eest = 10800, -- EEST wet = 0, -- WET sast = 7200, -- SAST - hast = -36000, -- HAST - hadt = -32400, -- HADT + hst = -36000, -- HST + hdt = -32400, -- HDT akst = -32400, -- AKST akdt = -28800, -- AKDT ast = -14400, -- AST @@ -147,7 +146,6 @@ OFFSET = { galt = -21600, -- GALT gamt = -32400, -- GAMT sbt = 39600, -- SBT - hst = -36000, -- HST lint = 50400, -- LINT kost = 39600, -- KOST mht = 43200, -- MHT