Fix byte length counting if strlen overloading is used

This commit is contained in:
Rekky 2013-10-30 11:00:39 +04:00
parent 9827e58c56
commit ed0846da6f
1 changed files with 9 additions and 2 deletions

View File

@ -54,9 +54,16 @@ class SoapResponse extends CommonSoapResponse
header('Content-Type: ' . $this->getContentType());
// get content to send
$response = $this->getContent();
// 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
echo $response;
}
}
}