From e1c13480d1d32a28fee64d8c942b7485c161f7e9 Mon Sep 17 00:00:00 2001 From: mercury Date: Fri, 6 Dec 2024 23:36:43 +0400 Subject: [PATCH] mihomo: fix empty rules --- app/bot.php | 5 ++++- app/i18n.php | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/bot.php b/app/bot.php index 329eeda..d47f7a0 100644 --- a/app/bot.php +++ b/app/bot.php @@ -5328,7 +5328,7 @@ DNS-over-HTTPS with IP: $pac = $this->getPacConf(); $domain = $this->getDomain(); $hash = substr(md5($this->key), 0, 8); - $text[] = "Menu -> " . $this->i18n('xray') . " -> $type templates"; + $text[] = "Menu -> " . $this->i18n('xray') . " -> " . $this->i18n($type) . " templates"; $text[] = <<~outbound~ "~pac~" @@ -6141,6 +6141,9 @@ DNS-over-HTTPS with IP: $c = $this->clashRuleSet($c); if (!empty($c['rules'])) { $c['rules'] = $this->clashRules($c['rules']); + if (count($c['rules']) == 1) { + unset($c['rules']); + } } break; } diff --git a/app/i18n.php b/app/i18n.php index 0464e94..2d2c4b5 100644 --- a/app/i18n.php +++ b/app/i18n.php @@ -265,6 +265,10 @@ $i = [ 'en' => 'Vless', 'ru' => 'Vless', ], + 'clash' => [ + 'en' => 'mihomo', + 'ru' => 'mihomo', + ], 'geodb' => [ 'en' => 'GeoIp/GeoSite', 'ru' => 'GeoIp/GeoSite',