Compare commits

...

3 Commits

Author SHA1 Message Date
mercury 4fb039ffc4 fix choice default template sing-box update 2 2024-05-01 18:35:45 +04:00
mercury 0b7ae110fc fix choice default template sing-box update 2024-05-01 18:24:22 +04:00
mercury 6fb1931c2d fix choice default template sing-box 2024-05-01 17:52:17 +04:00
+9 -8
View File
@@ -3747,7 +3747,7 @@ DNS-over-HTTPS with IP:
'web_app' => ['url' => "https://$domain/pac?h=$hash&t=te&ty=$type"],
],
[
'text' => $this->i18n($pac["default{$type}template"] && !empty($pac["{$type}templates"][$pac["default{$type}template"]]) ? 'off' : 'on'),
'text' => $this->i18n($pac["default{$type}template"] && !empty($pac["{$type}templates"][base64_decode($pac["default{$type}template"])]) ? 'off' : 'on'),
'callback_data' => "/defaultTemplate $type",
],
];
@@ -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,19 +4182,19 @@ DNS-over-HTTPS with IP:
exit;
}
}
switch (true) {
case !empty($template) && $template == 'origin':
case empty($template) && empty($pac['default' . ($_GET['t'] == 's' ? 'v2ray' : 'sing') . 'template']):
case empty($template) && !empty($pac['default' . ($_GET['t'] == 's' ? 'v2ray' : 'sing') . 'template']) && empty($pac[($_GET['t'] == 's' ? 'v2ray' : 'sing') . 'templates'][$pac['default' . ($_GET['t'] == 's' ? 'v2ray' : 'sing') . 'template']]):
$c = json_decode(file_get_contents('/config/' . ($_GET['t'] == 's' ? 'v2ray' : 'sing') . '.json'), true);
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):
$c = $pac[$_GET['t'] == 's' ? 'v2raytemplates' : 'singtemplates'][$template];
$c = $pac["{$type}templates"][$template];
break;
default:
$c = $pac[$_GET['t'] == 's' ? 'v2raytemplates' : 'singtemplates'][base64_decode($pac['default' . ($_GET['t'] == 's' ? 'v2ray' : 'sing') . 'template'])];
$c = $pac["{$type}templates"][base64_decode($pac["default{$type}template"])];
break;
}