update: clash remove proxies empty group

This commit is contained in:
v2board 2023-03-08 02:42:54 +08:00
parent feb673cab3
commit 529a72dda5
3 changed files with 3 additions and 0 deletions

View File

@ -82,6 +82,7 @@ class Clash
$config['proxy-groups'] = array_filter($config['proxy-groups'], function($group) { $config['proxy-groups'] = array_filter($config['proxy-groups'], function($group) {
return $group['proxies']; return $group['proxies'];
}); });
$config['proxy-groups'] = array_values($config['proxy-groups']);
// Force the current subscription domain to be a direct rule // Force the current subscription domain to be a direct rule
$subsDomain = $_SERVER['HTTP_HOST']; $subsDomain = $_SERVER['HTTP_HOST'];
if ($subsDomain) { if ($subsDomain) {

View File

@ -71,6 +71,7 @@ class ClashMeta
$config['proxy-groups'] = array_filter($config['proxy-groups'], function($group) { $config['proxy-groups'] = array_filter($config['proxy-groups'], function($group) {
return $group['proxies']; return $group['proxies'];
}); });
$config['proxy-groups'] = array_values($config['proxy-groups']);
// Force the current subscription domain to be a direct rule // Force the current subscription domain to be a direct rule
$subsDomain = $_SERVER['HTTP_HOST']; $subsDomain = $_SERVER['HTTP_HOST'];
if ($subsDomain) { if ($subsDomain) {

View File

@ -78,6 +78,7 @@ class Stash
$config['proxy-groups'] = array_filter($config['proxy-groups'], function($group) { $config['proxy-groups'] = array_filter($config['proxy-groups'], function($group) {
return $group['proxies']; return $group['proxies'];
}); });
$config['proxy-groups'] = array_values($config['proxy-groups']);
// Force the current subscription domain to be a direct rule // Force the current subscription domain to be a direct rule
$subsDomain = $_SERVER['HTTP_HOST']; $subsDomain = $_SERVER['HTTP_HOST'];
if ($subsDomain) { if ($subsDomain) {