Make WordPress Core


Ignore:
Timestamp:
10/05/2016 03:23:54 AM (8 years ago)
Author:
dd32
Message:

HTTP: Update Requests to master (0048f3c) which fixes a number of outstanding issues.

Fixes #38070, #37733 by reverting part of [38429] and using the fix in Requests.
Fixes #37992 allowing for connecting to SSL resources on ports other than 443.
Fixes #37991 by not sending default ports in the Host: header.
Fixes #37839 to match and decode Chunked responses correctly.
Fixes #38232 allowing a SSL connection to ignore the hostname of the certificate when verification is disabled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-requests.php

    r38163 r38727  
    750750     */
    751751    protected static function decode_chunked($data) {
    752         if (!preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', trim($data))) {
     752        if (!preg_match('/^([0-9a-f]+)(?:;(?:[\w-]*)(?:=(?:(?:[\w-]*)*|"(?:[^\r\n])*"))?)*\r\n/i', trim($data))) {
    753753            return $data;
    754754        }
     755
     756
    755757
    756758        $decoded = '';
     
    758760
    759761        while (true) {
    760             $is_chunked = (bool) preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', $encoded, $matches);
     762            $is_chunked = (bool) preg_match('/^([0-9a-f]+)(?:;(?:[\w-]*)(?:=(?:(?:[\w-]*)*|"(?:[^\r\n])*"))?)*\r\n/i', $encoded, $matches);
    761763            if (!$is_chunked) {
    762764                // Looks like it's not chunked after all
Note: See TracChangeset for help on using the changeset viewer.