]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/class-http.php
WordPress 3.6.1
[autoinstalls/wordpress.git] / wp-includes / class-http.php
index b824285dabd3a1c70f5b155a66e80d5d48ae84ef..77ba4597dd4cc457bdfe54803a2730430ab51dcd 100644 (file)
@@ -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;
        }
 
        /**