fix #7624 - email_when_release_is
authorleon <leon@roojs.com>
Thu, 27 Apr 2023 03:57:26 +0000 (11:57 +0800)
committerleon <leon@roojs.com>
Thu, 27 Apr 2023 03:57:26 +0000 (11:57 +0800)
HTTP/Request.php

index 5f014d8..3b56c2f 100644 (file)
@@ -991,7 +991,7 @@ class HTTP_Request
         $request = $this->_method . ' ' . $url . ' HTTP/' . $this->_http . "\r\n";\r
 \r
         if (in_array($this->_method, $this->_bodyDisallowed) ||\r
-            (0 == strlen($this->_body) && (HTTP_REQUEST_METHOD_POST != $this->_method ||\r
+            ((empty($this->_body) || 0 == strlen($this->_body)) && (HTTP_REQUEST_METHOD_POST != $this->_method ||\r
              (empty($this->_postData) && empty($this->_postFiles)))))\r
         {\r
             $this->removeHeader('Content-Type');\r
@@ -1067,7 +1067,7 @@ class HTTP_Request
             $request .= $postdata;\r
 \r
         // Explicitly set request body\r
-        } elseif (0 < strlen($this->_body)) {\r
+        } elseif (!empty($this->_body) && 0 < strlen($this->_body)) {\r
 \r
             $request .= 'Content-Length: ' .\r
                         (HTTP_REQUEST_MBSTRING? mb_strlen($this->_body, 'iso-8859-1'): strlen($this->_body)) .\r