WordPress.org

Make WordPress Core

Changeset 25052


Ignore:
Timestamp:
08/18/2013 08:21:11 AM (8 years ago)
Author:
dd32
Message:

WP_HTTP: Curl: When using Stream-to-file on servers using mbstring.func_overload ensure that the file is written out correctly. Props DrProtocols. See #25061 for 3.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.6/wp-includes/class-http.php

    r24896 r25052  
    13031303     */
    13041304    private function stream_body( $handle, $data ) {
     1305        if ( function_exists( 'ini_get' ) && ( ini_get( 'mbstring.func_overload' ) & 2 ) && function_exists( 'mb_internal_encoding' ) ) {
     1306            $mb_encoding = mb_internal_encoding();
     1307            mb_internal_encoding( 'ISO-8859-1' );
     1308        }
     1309
    13051310        if ( $this->max_body_length && ( strlen( $this->body ) + strlen( $data ) ) > $this->max_body_length )
    13061311            $data = substr( $data, 0, ( $this->max_body_length - strlen( $this->body ) ) );
     
    13111316            $this->body .= $data;
    13121317
    1313         return strlen( $data );
     1318        $data_length = strlen( $data );
     1319
     1320        if ( isset( $mb_encoding ) )
     1321            mb_internal_encoding( $mb_encoding );
     1322
     1323        return $data_length;
    13141324    }
    13151325
Note: See TracChangeset for help on using the changeset viewer.