修复部分订阅中节点名称含有NETWORK时 导致FLAG 识别为TW的问题

This commit is contained in:
jerrykuku 2021-02-27 13:52:40 +08:00
parent d39d753391
commit 31b636aa74
2 changed files with 3 additions and 3 deletions

View File

@ -89,8 +89,9 @@ function _M.get_flag(remark, host)
local iso_code = nil
if (remark ~= nil) then
remark = string.gsub(remark, "NETWORKS", "")
for i, v in pairs(emoji_table) do
if (string.find(string.lower(remark), string.lower(v))) then
if (string.find(string.lower(remark), string.lower(v)) ~= nil) then
iso_code = string.lower(iso_table[i])
break
end

View File

@ -1,7 +1,6 @@
local ucursor = require 'luci.model.uci'.cursor()
local name = 'vssr'
local json = require 'luci.jsonc'
local proto = 'socks'
local socks_switch = ucursor:get_first(name, 'socks5_proxy', 'enable_server')
local auth_type = ucursor:get_first(name, 'socks5_proxy', 'enable_auth')
local local_port = ucursor:get_first(name, 'socks5_proxy', 'local_port')
@ -15,7 +14,7 @@ local http_user = ucursor:get_first(name, 'http_proxy', 'http_user')
local http_pass = ucursor:get_first(name, 'http_proxy', 'http_pass')
function gen_inbound(sw, auth_type, local_port, user, pass, proto)
local bound = {}
local bound
if sw == 0 then
bound = nil
else