瀏覽代碼

Fix strlen(): Passing null

walkor 3 年之前
父節點
當前提交
24c79f6677
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Protocols/Http.php

+ 1 - 1
Protocols/Http.php

@@ -214,7 +214,7 @@ class Http
                 }
                 unset($connection->__header);
             }
-            $body_len = \strlen($response);
+            $body_len = \strlen((string)$response);
             return "HTTP/1.1 200 OK\r\nServer: workerman\r\n{$ext_header}Connection: keep-alive\r\nContent-Type: text/html;charset=utf-8\r\nContent-Length: $body_len\r\n\r\n$response";
         }