From e745c2a5be6bc6eb92403f4f984fc9379ddfdcd5 Mon Sep 17 00:00:00 2001 From: v2board Date: Wed, 8 Mar 2023 02:26:10 +0800 Subject: [PATCH] update: clash remove proxies empty group --- app/Http/Controllers/Client/Protocols/Clash.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/Client/Protocols/Clash.php b/app/Http/Controllers/Client/Protocols/Clash.php index 03446b12..cd245c04 100644 --- a/app/Http/Controllers/Client/Protocols/Clash.php +++ b/app/Http/Controllers/Client/Protocols/Clash.php @@ -78,6 +78,10 @@ class Clash if ($isFilter) continue; $config['proxy-groups'][$k]['proxies'] = array_merge($config['proxy-groups'][$k]['proxies'], $proxies); } + + $config['proxy-groups'] = array_filter($config['proxy-groups'], function($group) { + return $group['proxies']; + }); // Force the current subscription domain to be a direct rule $subsDomain = $_SERVER['HTTP_HOST']; if ($subsDomain) {