From 98ac5cb6809b20ccad88c40f5da43cf4b7dd007c Mon Sep 17 00:00:00 2001 From: root Date: Sun, 22 Aug 2021 00:09:37 +0800 Subject: [PATCH] Fix Clash Json decode error --- app/Http/Controllers/Client/Protocols/Clash.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Client/Protocols/Clash.php b/app/Http/Controllers/Client/Protocols/Clash.php index ce6364e0..8c9dc506 100644 --- a/app/Http/Controllers/Client/Protocols/Clash.php +++ b/app/Http/Controllers/Client/Protocols/Clash.php @@ -112,7 +112,7 @@ class Clash if ($server['tls']) { $array['tls'] = true; if ($server['tlsSettings']) { - $tlsSettings = json_decode($server['tlsSettings'], true); + $tlsSettings = $server['tlsSettings']; if (isset($tlsSettings['allowInsecure']) && !empty($tlsSettings['allowInsecure'])) $array['skip-cert-verify'] = ($tlsSettings['allowInsecure'] ? true : false); if (isset($tlsSettings['serverName']) && !empty($tlsSettings['serverName'])) @@ -122,7 +122,7 @@ class Clash if ($server['network'] === 'ws') { $array['network'] = 'ws'; if ($server['networkSettings']) { - $wsSettings = json_decode($server['networkSettings'], true); + $wsSettings = $server['networkSettings']; if (isset($wsSettings['path']) && !empty($wsSettings['path'])) $array['ws-path'] = $wsSettings['path']; if (isset($wsSettings['headers']['Host']) && !empty($wsSettings['headers']['Host'])) @@ -132,7 +132,7 @@ class Clash if ($server['network'] === 'grpc') { $array['network'] = 'grpc'; if ($server['networkSettings']) { - $grpcObject = json_decode($server['networkSettings'], true); + $grpcObject = $server['networkSettings']; $array['grpc-opts'] = []; $array['grpc-opts']['grpc-service-name'] = $grpcObject['serviceName']; }