From 6718a618906c50a66577a2a088f7d3bd218fc81b Mon Sep 17 00:00:00 2001 From: tokumeikoi Date: Mon, 27 Dec 2021 00:13:27 +0800 Subject: [PATCH] update: support stash --- app/Http/Controllers/Client/Protocols/Clash.php | 10 +++++----- app/Http/Controllers/Client/Protocols/Stash.php | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/Client/Protocols/Clash.php b/app/Http/Controllers/Client/Protocols/Clash.php index 2fb191a4..bb0c0484 100644 --- a/app/Http/Controllers/Client/Protocols/Clash.php +++ b/app/Http/Controllers/Client/Protocols/Clash.php @@ -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); } } } diff --git a/app/Http/Controllers/Client/Protocols/Stash.php b/app/Http/Controllers/Client/Protocols/Stash.php index f6c31362..34b9b728 100644 --- a/app/Http/Controllers/Client/Protocols/Stash.php +++ b/app/Http/Controllers/Client/Protocols/Stash.php @@ -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); } } }