From 75a753cc451f44dcb98f00d2cc194d275ea86d50 Mon Sep 17 00:00:00 2001 From: xiaorouji <60100640+xiaorouji@users.noreply.github.com> Date: Thu, 9 Feb 2023 14:55:23 +0800 Subject: [PATCH] luci: fix rule update args --- .../root/usr/share/passwall/rule_update.lua | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/luci-app-passwall/root/usr/share/passwall/rule_update.lua b/luci-app-passwall/root/usr/share/passwall/rule_update.lua index 75924943d..13ebcd544 100755 --- a/luci-app-passwall/root/usr/share/passwall/rule_update.lua +++ b/luci-app-passwall/root/usr/share/passwall/rule_update.lua @@ -340,24 +340,26 @@ local function fetch_geosite() end if arg[2] then - if arg[2]:find("gfwlist") then - gfwlist_update = 1 - end - if arg[2]:find("chnroute") then - chnroute_update = 1 - end - if arg[2]:find("chnroute6") then - chnroute6_update = 1 - end - if arg[2]:find("chnlist") then - chnlist_update = 1 - end - if arg[2]:find("geoip") then - geoip_update = 1 - end - if arg[2]:find("geosite") then - geosite_update = 1 - end + string.gsub(arg[2], '[^' .. "," .. ']+', function(w) + if w == "gfwlist" then + gfwlist_update = 1 + end + if w == "chnroute" then + chnroute_update = 1 + end + if w == "chnroute6" then + chnroute6_update = 1 + end + if w == "chnlist" then + chnlist_update = 1 + end + if w == "geoip" then + geoip_update = 1 + end + if w == "geosite" then + geosite_update = 1 + end + end) else gfwlist_update = ucic:get_first(name, 'global_rules', "gfwlist_update", 1) chnroute_update = ucic:get_first(name, 'global_rules', "chnroute_update", 1)