mirror of
https://github.com/bol-van/zapret.git
synced 2024-12-02 14:40:52 +03:00
Update zapret-tpws.lua
fix validation function
This commit is contained in:
parent
7be758d995
commit
bc4ed19080
@ -2,10 +2,10 @@ m = Map("zapret", translate("TPWS Proxy Settings"))
|
|||||||
c = m:section(NamedSection, "tpws", "zapret", translate("Configuration"))
|
c = m:section(NamedSection, "tpws", "zapret", translate("Configuration"))
|
||||||
opt = c:option(Value, "opts", translate("TPWS Options"))
|
opt = c:option(Value, "opts", translate("TPWS Options"))
|
||||||
opt.placeholder = "--split-pos=2"
|
opt.placeholder = "--split-pos=2"
|
||||||
function checkDoubleMinus(inputString)
|
function opt.validate(self, value)
|
||||||
-- Split the string into words
|
-- Split the string into words
|
||||||
local words = {}
|
local words = {}
|
||||||
for word in inputString:gmatch("%S+") do
|
for word in value:gmatch("%S+") do
|
||||||
table.insert(words, word)
|
table.insert(words, word)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ function checkDoubleMinus(inputString)
|
|||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
opt.validate = checkDoubleMinus(opt.Value)
|
|
||||||
b = c:option(Flag, "block_quic", "Block QUIC", translate("Block QUIC protocol to come outside"))
|
b = c:option(Flag, "block_quic", "Block QUIC", translate("Block QUIC protocol to come outside"))
|
||||||
lp = c:option(Value, "port", translate("Listen Port"))
|
lp = c:option(Value, "port", translate("Listen Port"))
|
||||||
lp.datatype = "port"
|
lp.datatype = "port"
|
||||||
|
Loading…
Reference in New Issue
Block a user