mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@38727 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -749,15 +749,17 @@ class Requests {
|
||||
* @return string Decoded body
|
||||
*/
|
||||
protected static function decode_chunked($data) {
|
||||
if (!preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', trim($data))) {
|
||||
if (!preg_match('/^([0-9a-f]+)(?:;(?:[\w-]*)(?:=(?:(?:[\w-]*)*|"(?:[^\r\n])*"))?)*\r\n/i', trim($data))) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$decoded = '';
|
||||
$encoded = $data;
|
||||
|
||||
while (true) {
|
||||
$is_chunked = (bool) preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', $encoded, $matches);
|
||||
$is_chunked = (bool) preg_match('/^([0-9a-f]+)(?:;(?:[\w-]*)(?:=(?:(?:[\w-]*)*|"(?:[^\r\n])*"))?)*\r\n/i', $encoded, $matches);
|
||||
if (!$is_chunked) {
|
||||
// Looks like it's not chunked after all
|
||||
return $data;
|
||||
|
||||
Reference in New Issue
Block a user