From 4fb039ffc4b87a647c709da423324f52c9dc21a5 Mon Sep 17 00:00:00 2001 From: mercury Date: Wed, 1 May 2024 18:35:45 +0400 Subject: [PATCH] fix choice default template sing-box update 2 --- app/bot.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/bot.php b/app/bot.php index 25ee6ff..20972ae 100644 --- a/app/bot.php +++ b/app/bot.php @@ -4126,6 +4126,7 @@ DNS-over-HTTPS with IP: public function subscription() { + $type = $_GET['t'] == 's' ? 'v2ray' : 'sing'; $pac = $this->getPacConf(); $domain = $pac['domain'] ?: $this->ip; $xr = $this->getXray(); @@ -4138,7 +4139,7 @@ DNS-over-HTTPS with IP: if (empty($v['off'])) { $flag = false; } - $template = base64_decode($_GET['t'] == 's' ? $v['v2raytemplate'] : $v['singtemplate']); + $template = base64_decode($v["{$type}template"]); $uid = $v['id']; break; } @@ -4181,11 +4182,11 @@ DNS-over-HTTPS with IP: exit; } } - $type = $_GET['t'] == 's' ? 'v2ray' : 'sing'; switch (true) { case !empty($template) && $template == 'origin': case empty($template) && empty($pac["default{$type}template"]): case empty($template) && empty($pac["{$type}templates"][base64_decode($pac["default{$type}template"])]): + case !empty($template) && empty($pac["{$type}templates"][$template]): $c = json_decode(file_get_contents("/config/{$type}.json"), true); break; case !empty($template):