From 1b07047f634d26e1c5ab293d9579a8a9516c5448 Mon Sep 17 00:00:00 2001 From: NewUse <7342068+NewUse@users.noreply.github.com> Date: Fri, 27 Sep 2024 17:30:11 +0300 Subject: [PATCH] Update zapret-tpws.lua fixed validation function --- .../luci-app-zapret-tpws/luasrc/model/cbi/zapret-tpws.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 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 a6c8edb..78ed3c8 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 @@ -8,8 +8,8 @@ function opt.validate(self, value) table.insert(words, word) end for _, word in ipairs(words) do - if not word:sub(1, 2) == "--" then - return nil + if word:sub(1, 2) ~= "--" then + return nil, translate("The field value \"TPWS Options\" has incorrect format") end end return value