Fix byte length counting if strlen overloading is used
This commit is contained in:
parent
9827e58c56
commit
ed0846da6f
|
@ -54,8 +54,15 @@ class SoapResponse extends CommonSoapResponse
|
||||||
header('Content-Type: ' . $this->getContentType());
|
header('Content-Type: ' . $this->getContentType());
|
||||||
// get content to send
|
// get content to send
|
||||||
$response = $this->getContent();
|
$response = $this->getContent();
|
||||||
|
|
||||||
// set Content-Length header
|
// set Content-Length header
|
||||||
header('Content-Length: '. strlen($response));
|
if (function_exists('mb_strlen')) {
|
||||||
|
$length = mb_strlen($response, '8bit');
|
||||||
|
} else {
|
||||||
|
$length = strlen($response);
|
||||||
|
}
|
||||||
|
header('Content-Length: ' . $length);
|
||||||
|
|
||||||
// send response to client
|
// send response to client
|
||||||
echo $response;
|
echo $response;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue