From bc4ed19080bd7aa5643a1124223a207631c058bf Mon Sep 17 00:00:00 2001 From: NewUse <7342068+NewUse@users.noreply.github.com> Date: Thu, 26 Sep 2024 09:03:28 +0300 Subject: [PATCH] Update zapret-tpws.lua fix validation function --- .../luci-app-zapret-tpws/luasrc/model/cbi/zapret-tpws.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/compile/openwrt/package/zapret/luci-app-zapret-tpws/luasrc/model/cbi/zapret-tpws.lua b/docs/compile/openwrt/package/zapret/luci-app-zapret-tpws/luasrc/model/cbi/zapret-tpws.lua index 0760f1e..72e6738 100644 --- a/docs/compile/openwrt/package/zapret/luci-app-zapret-tpws/luasrc/model/cbi/zapret-tpws.lua +++ b/docs/compile/openwrt/package/zapret/luci-app-zapret-tpws/luasrc/model/cbi/zapret-tpws.lua @@ -2,10 +2,10 @@ m = Map("zapret", translate("TPWS Proxy Settings")) c = m:section(NamedSection, "tpws", "zapret", translate("Configuration")) opt = c:option(Value, "opts", translate("TPWS Options")) opt.placeholder = "--split-pos=2" -function checkDoubleMinus(inputString) +function opt.validate(self, value) -- Split the string into words local words = {} - for word in inputString:gmatch("%S+") do + for word in value:gmatch("%S+") do table.insert(words, word) end @@ -18,7 +18,7 @@ function checkDoubleMinus(inputString) return true end -opt.validate = checkDoubleMinus(opt.Value) + b = c:option(Flag, "block_quic", "Block QUIC", translate("Block QUIC protocol to come outside")) lp = c:option(Value, "port", translate("Listen Port")) lp.datatype = "port"