chore: cleanup the patch code

This commit is contained in:
wwqgtxx
2024-09-11 16:10:35 +08:00
parent 8230bc8e7d
commit 0a2f606e1b
18 changed files with 122 additions and 185 deletions

View File

@@ -8,6 +8,8 @@ import (
"path/filepath"
"strconv"
"strings"
"github.com/metacubex/mihomo/constant/features"
)
const Name = "mihomo"
@@ -73,7 +75,7 @@ func (p *path) Resolve(path string) string {
// IsSafePath return true if path is a subpath of homedir
func (p *path) IsSafePath(path string) bool {
if p.allowUnsafePath {
if p.allowUnsafePath || features.CMFA {
return true
}
homedir := p.HomeDir()