diff --git a/VERSION b/VERSION index d5e98f7..785cda8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.2 \ No newline at end of file +1.3.3 \ No newline at end of file diff --git a/flight/net/Response.php b/flight/net/Response.php index 2b22158..8c72a21 100644 --- a/flight/net/Response.php +++ b/flight/net/Response.php @@ -107,7 +107,7 @@ class Response { * Sets the HTTP status of the response. * * @param int $code HTTP status code. - * @return object Self reference + * @return object|int Self reference * @throws \Exception If invalid status code */ public function status($code = null) { @@ -247,7 +247,11 @@ class Response { } // Send content length - if (($length = strlen($this->body)) > 0) { + $length = (extension_loaded('mbstring')) ? + mb_strlen($this->body, 'latin1') : + strlen($this->body); + + if ($length > 0) { header('Content-Length: '.$length); }