diff --git a/app/bot.php b/app/bot.php index d746c1d..d9575ba 100644 --- a/app/bot.php +++ b/app/bot.php @@ -1237,11 +1237,11 @@ DNS-over-HTTPS with IP: PAC ({$pac['time']} / {$pac['sz']}): $scheme://$ip/pac?h=$hash&a=127.0.0.1&p=1080 text; - $urls[] = [ + $urls[0][] = [ 'text' => "PAC", 'url' => "$scheme://$ip/pac?h=$hash&a=127.0.0.1&p=1080", ]; - $urls[] = [ + $urls[1][] = [ 'text' => "PAC Wireguard proxy", 'url' => "$scheme://$ip/pac?h=$hash&a=10.10.0.3&p=1080", ]; @@ -1255,7 +1255,7 @@ DNS-over-HTTPS with IP: Shadowsocks-android PAC ({$mpac['time']} / {$mpac['sz']}): $scheme://$ip/pac?h=$hash&t=mpac text; - $urls[] = [ + $urls[2][] = [ 'text' => "PAC ShadowSocks(Android)", 'url' => "$scheme://$ip/pac?h=$hash&t=mpac", ]; @@ -1269,11 +1269,11 @@ DNS-over-HTTPS with IP: Reverse PAC ({$rpac['time']} / {$rpac['sz']}): $scheme://$ip/pac?h=$hash&t=rpac&a=127.0.0.1&p=1080 text; - $urls[] = [ + $urls[0][] = [ 'text' => "Reverse PAC", 'url' => "$scheme://$ip/pac?h=$hash&t=rpac", ]; - $urls[] = [ + $urls[1][] = [ 'text' => "Reverse PAC Wireguard proxy", 'url' => "$scheme://$ip/pac?h=$hash&t=rpac&a=10.10.0.3", ]; @@ -1287,13 +1287,13 @@ DNS-over-HTTPS with IP: Reverse shadowsocks-android PAC ({$rmpac['time']} / {$rmpac['sz']}): $scheme://$ip/pac?h=$hash&t=rmpac text; - $urls[] = [ + $urls[2][] = [ 'text' => "Reverse PAC SS(Android)", 'url' => "$scheme://$ip/pac?h=$hash&t=rmpac", ]; } if ($urls) { - $data = array_chunk($urls, 2); + $data = $urls; } if ($conf['zapret']) { $data[] = [ diff --git a/app/index.php b/app/index.php index a1a7930..8924d10 100644 --- a/app/index.php +++ b/app/index.php @@ -17,7 +17,7 @@ $type = $_GET['t'] ?? 'pac'; $address = $_GET['a'] ?: '127.0.0.1'; $port = $_GET['p'] ?: '1080'; $hash = $_GET['h']; -if ($hash == substr(md5($key), 0, 8)) { +if ($hash == substr(md5($c['key']), 0, 8)) { if (file_exists($file = __DIR__ . "/zapretlists/$type")) { $pac = file_get_contents($file); header('Content-Type: text/plain'); diff --git a/app/updatepac.php b/app/updatepac.php index b194af6..5a9a3ed 100644 --- a/app/updatepac.php +++ b/app/updatepac.php @@ -308,7 +308,7 @@ $load = [ switch ($_SERVER['argv'][1]) { case 'start': - $bot = new Bot($key); + $bot = new Bot($c['key']); $bot->input['chat'] = $_SERVER['argv'][2]; $bot->input['message_id'] = $_SERVER['argv'][3]; $bot->input['callback_id'] = $_SERVER['argv'][4];