Passed
Push — main ( ef2771...be8934 )
by
unknown
05:12
created
modules/singbox.php 1 patch
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -97,7 +97,9 @@  discard block
 block discarded – undo
97 97
             "max_early_data" => $pathProcess['max_early_data'],
98 98
             "early_data_header_name" => "Sec-WebSocket-Protocol",
99 99
         ];
100
-        if ($configResult["transport"]["headers"]["Host"] === "" || is_null($configResult["transport"]["headers"]["Host"])) return null;
100
+        if ($configResult["transport"]["headers"]["Host"] === "" || is_null($configResult["transport"]["headers"]["Host"])) {
101
+            return null;
102
+        }
101 103
     } elseif ($decode_vmess["net"] === "grpc") {
102 104
         $configResult["transport"] = [
103 105
             "type" => $decode_vmess["net"],
@@ -106,7 +108,9 @@  discard block
 block discarded – undo
106 108
             "ping_timeout" => "15s",
107 109
             "permit_without_stream" => false,
108 110
         ];
109
-      if ($configResult["transport"]["service_name"] === "" || is_null($configResult["transport"]["service_name"])) return null;
111
+      if ($configResult["transport"]["service_name"] === "" || is_null($configResult["transport"]["service_name"])) {
112
+          return null;
113
+      }
110 114
     }
111 115
 
112 116
     return $configResult;
@@ -200,8 +204,12 @@  discard block
 block discarded – undo
200 204
                 $transportTypes[$decoded_vless["params"]["type"]];
201 205
         }
202 206
     }
203
-    if ($decoded_vless["params"]["type"] === "ws" && ($configResult["transport"]["headers"]["Host"] === "" || is_null($configResult["transport"]["headers"]["Host"]))) return null;
204
-    if ($decoded_vless["params"]["type"] === "grpc" && ($configResult["transport"]["service_name"] === "" || is_null($configResult["transport"]["service_name"]))) return null;
207
+    if ($decoded_vless["params"]["type"] === "ws" && ($configResult["transport"]["headers"]["Host"] === "" || is_null($configResult["transport"]["headers"]["Host"]))) {
208
+        return null;
209
+    }
210
+    if ($decoded_vless["params"]["type"] === "grpc" && ($configResult["transport"]["service_name"] === "" || is_null($configResult["transport"]["service_name"]))) {
211
+        return null;
212
+    }
205 213
     return $configResult;
206 214
 }
207 215
 
@@ -264,8 +272,12 @@  discard block
 block discarded – undo
264 272
                 $transportTypes[$decoded_trojan["params"]["type"]];
265 273
         }
266 274
     }
267
-    if ($decoded_trojan["params"]["type"] === "ws" && ($configResult["transport"]["headers"]["Host"] === "" || is_null($configResult["transport"]["headers"]["Host"]))) return null;
268
-    if ($decoded_trojan["params"]["type"] === "grpc" && ($configResult["transport"]["service_name"] === "" || is_null($configResult["transport"]["service_name"]))) return null;
275
+    if ($decoded_trojan["params"]["type"] === "ws" && ($configResult["transport"]["headers"]["Host"] === "" || is_null($configResult["transport"]["headers"]["Host"]))) {
276
+        return null;
277
+    }
278
+    if ($decoded_trojan["params"]["type"] === "grpc" && ($configResult["transport"]["service_name"] === "" || is_null($configResult["transport"]["service_name"]))) {
279
+        return null;
280
+    }
269 281
     return $configResult;
270 282
 }
271 283
 
Please login to merge, or discard this patch.