Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

check mbstring.func_overload before using strlen()

  • Loading branch information...
commit f39c683130164e64214eb7e0958763a56eb71748 1 parent e532875
Yasushi Ichikawa (ichikaway) ichikaway authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/Cake/Network/CakeResponse.php
6 lib/Cake/Network/CakeResponse.php
View
@@ -352,7 +352,11 @@ public function send() {
$this->_sendHeader('Content-Type', "{$this->_contentType}; charset={$this->_charset}");
$shouldSetLength = empty($this->_headers['Content-Length']) && !in_array($this->_status, range(301, 307));
if ($shouldSetLength && !$this->outputCompressed()) {
- $this->_headers['Content-Length'] = strlen($this->_body);
+ if (ini_get('mbstring.func_overload') & 2 && function_exists('mb_strlen')) {
+ $this->_headers['Content-Length'] = mb_strlen($this->_body, '8bit');
+ } else {
+ $this->_headers['Content-Length'] = strlen($this->_body);
+ }
}
foreach ($this->_headers as $header => $value) {
$this->_sendHeader($header, $value);
Please sign in to comment.
Something went wrong with that request. Please try again.