Make WordPress Core

Changeset 38895


Ignore:
Timestamp:
10/25/2016 12:46:23 AM (8 years ago)
Author:
dd32
Message:

HTTP: Call mbstring_binary_safe_encoding() before making a request with Requests to avoid issues with mbstring.func_overload.

Props SergeyBiryukov.
Merges [38894] to the 4.6 branch.
Fixes #38226.

Location:
branches/4.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.6

  • branches/4.6/src/wp-includes/class-http.php

    r38728 r38895  
    364364        }
    365365
     366        // Avoid issues where mbstring.func_overload is enabled
     367        mbstring_binary_safe_encoding();
     368
    366369        try {
    367370            $requests_response = Requests::request( $url, $headers, $data, $type, $options );
     
    377380            $response = new WP_Error( 'http_request_failed', $e->getMessage() );
    378381        }
     382
     383        reset_mbstring_encoding();
    379384
    380385        /**
Note: See TracChangeset for help on using the changeset viewer.