mirror of
http://bgp.hk.skcks.cn:10088/github.com/oneclickvirt/ecs
synced 2026-04-20 12:50:58 +08:00
fix:以文本结构匹配避免正则匹配越界
This commit is contained in:
@@ -44,16 +44,10 @@ def modify_speed_go(filepath):
|
||||
)
|
||||
|
||||
content = re.sub(
|
||||
r'''
|
||||
\n\s*// 对于三网测速(cmcc、cu、ct),优先使用 privatespeedtest 进行私有测速
|
||||
\s*\n
|
||||
\s*opLower\s*:=\s*strings\.ToLower\(operator\)
|
||||
[\s\S]*?
|
||||
\n\s*}\s*
|
||||
''',
|
||||
r'^[ \t]*// 对于三网测速(cmcc、cu、ct),优先使用 privatespeedtest 进行私有测速[\s\S]*?\n\s*\n',
|
||||
'\n',
|
||||
content,
|
||||
flags=re.MULTILINE | re.VERBOSE
|
||||
flags=re.MULTILINE
|
||||
)
|
||||
|
||||
write_file(filepath, content)
|
||||
|
||||
@@ -189,6 +189,7 @@ func CustomSP(platform, operator string, num int, language string) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
var url, parseType string
|
||||
if strings.ToLower(platform) == "cn" {
|
||||
if strings.ToLower(operator) == "cmcc" {
|
||||
|
||||
Reference in New Issue
Block a user