X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/61343b82c4f0da4c68e4c6373daafff4a81efdd1..a6f44f0edcda2471c5a33e4156c1c9488c7f3210:/wp-includes/class-http.php diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index b824285d..77ba4597 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -1302,6 +1302,11 @@ class WP_Http_Curl { * @return int */ private function stream_body( $handle, $data ) { + if ( function_exists( 'ini_get' ) && ( ini_get( 'mbstring.func_overload' ) & 2 ) && function_exists( 'mb_internal_encoding' ) ) { + $mb_encoding = mb_internal_encoding(); + mb_internal_encoding( 'ISO-8859-1' ); + } + if ( $this->max_body_length && ( strlen( $this->body ) + strlen( $data ) ) > $this->max_body_length ) $data = substr( $data, 0, ( $this->max_body_length - strlen( $this->body ) ) ); @@ -1310,7 +1315,12 @@ class WP_Http_Curl { else $this->body .= $data; - return strlen( $data ); + $data_length = strlen( $data ); + + if ( isset( $mb_encoding ) ) + mb_internal_encoding( $mb_encoding ); + + return $data_length; } /**