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) {
if (!is_array($config['proxy-groups'][$k]['proxies'])) continue;
$isFilter = false;
foreach ($config['proxy-groups'][$k]['proxies'] as $srcProxie) {
foreach ($proxies as $dstProxie) {
if ($this->isMatch($srcProxie, $dstProxie)) {
foreach ($config['proxy-groups'][$k]['proxies'] as $src) {
foreach ($proxies as $dst) {
if ($this->isMatch($src, $dst)) {
$isFilter = true;
$config['proxy-groups'][$k]['proxies'] = array_diff($config['proxy-groups'][$k]['proxies'], [$srcProxie]);
array_push($config['proxy-groups'][$k]['proxies'], $dstProxie);
$config['proxy-groups'][$k]['proxies'] = array_diff($config['proxy-groups'][$k]['proxies'], [$src]);
array_push($config['proxy-groups'][$k]['proxies'], $dst);
}
}
}

View File

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