update: support stash

This commit is contained in:
tokumeikoi 2021-12-27 00:13:27 +08:00
parent 333611da48
commit 6718a61890
2 changed files with 10 additions and 10 deletions

View File

@ -53,12 +53,12 @@ class Clash
foreach ($config['proxy-groups'] as $k => $v) { foreach ($config['proxy-groups'] as $k => $v) {
if (!is_array($config['proxy-groups'][$k]['proxies'])) continue; if (!is_array($config['proxy-groups'][$k]['proxies'])) continue;
$isFilter = false; $isFilter = false;
foreach ($config['proxy-groups'][$k]['proxies'] as $srcProxie) { foreach ($config['proxy-groups'][$k]['proxies'] as $src) {
foreach ($proxies as $dstProxie) { foreach ($proxies as $dst) {
if ($this->isMatch($srcProxie, $dstProxie)) { if ($this->isMatch($src, $dst)) {
$isFilter = true; $isFilter = true;
$config['proxy-groups'][$k]['proxies'] = array_diff($config['proxy-groups'][$k]['proxies'], [$srcProxie]); $config['proxy-groups'][$k]['proxies'] = array_diff($config['proxy-groups'][$k]['proxies'], [$src]);
array_push($config['proxy-groups'][$k]['proxies'], $dstProxie); array_push($config['proxy-groups'][$k]['proxies'], $dst);
} }
} }
} }

View File

@ -54,12 +54,12 @@ class Stash
foreach ($config['proxy-groups'] as $k => $v) { foreach ($config['proxy-groups'] as $k => $v) {
if (!is_array($config['proxy-groups'][$k]['proxies'])) continue; if (!is_array($config['proxy-groups'][$k]['proxies'])) continue;
$isFilter = false; $isFilter = false;
foreach ($config['proxy-groups'][$k]['proxies'] as $srcProxie) { foreach ($config['proxy-groups'][$k]['proxies'] as $src) {
foreach ($proxies as $dstProxie) { foreach ($proxies as $dst) {
if ($this->isMatch($srcProxie, $dstProxie)) { if ($this->isMatch($src, $dst)) {
$isFilter = true; $isFilter = true;
$config['proxy-groups'][$k]['proxies'] = array_diff($config['proxy-groups'][$k]['proxies'], [$srcProxie]); $config['proxy-groups'][$k]['proxies'] = array_diff($config['proxy-groups'][$k]['proxies'], [$src]);
array_push($config['proxy-groups'][$k]['proxies'], $dstProxie); array_push($config['proxy-groups'][$k]['proxies'], $dst);
} }
} }
} }