diff --git a/app/Utils/Clash.php b/app/Utils/Clash.php index f6eae372..457e51ca 100644 --- a/app/Utils/Clash.php +++ b/app/Utils/Clash.php @@ -32,7 +32,7 @@ class Clash if ($server['tls']) { $array['tls'] = true; - if (isset($server['tlsSettings'])) { + if ($server['tlsSettings']) { $tlsSettings = json_decode($server['tlsSettings'], true); if (isset($tlsSettings['allowInsecure']) && !empty($tlsSettings['allowInsecure'])) $array['skip-cert-verify'] = ($tlsSettings['allowInsecure'] ? true : false); @@ -42,7 +42,7 @@ class Clash } if ($server['network'] === 'ws') { $array['network'] = 'ws'; - if (isset($server['networkSettings'])) { + if ($server['networkSettings']) { $wsSettings = json_decode($server['networkSettings'], true); if (isset($wsSettings['path']) && !empty($wsSettings['path'])) $array['ws-path'] = $wsSettings['path']; @@ -52,7 +52,7 @@ class Clash } if ($server['network'] === 'grpc') { $array['network'] = 'grpc'; - if (isset($server['networkSettings'])) { + if ($server['networkSettings']) { $grpcObject = json_decode($server['networkSettings'], true); $array['grpc-opts'] = []; $array['grpc-opts']['grpc-service-name'] = $grpcObject['serviceName']; diff --git a/app/Utils/Shadowrocket.php b/app/Utils/Shadowrocket.php index e772aebf..95db5020 100644 --- a/app/Utils/Shadowrocket.php +++ b/app/Utils/Shadowrocket.php @@ -46,7 +46,7 @@ class Shadowrocket } if ($server['network'] === 'grpc') { $config['obfs'] = "grpc"; - if (isset($server['networkSettings'])) { + if ($server['networkSettings']) { $grpcSettings = json_decode($server['networkSettings'], true); if (isset($grpcSettings['serviceName']) && !empty($grpcSettings['serviceName'])) $config['path'] = $grpcSettings['serviceName'];