Changeset 38728 for branches/4.6
- Timestamp:
- 10/05/2016 03:26:37 AM (8 years ago)
- Location:
- branches/4.6
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.6
-
branches/4.6/src/wp-includes/Requests/IRI.php
r38049 r38728 689 689 if ($this->ipath !== '' && 690 690 ( 691 $isauthority && ( 692 $this->ipath[0] !== '/' || 693 substr($this->ipath, 0, 2) === '//' 694 ) || 691 $isauthority && $this->ipath[0] !== '/' || 695 692 ( 696 693 $this->scheme === null && -
branches/4.6/src/wp-includes/Requests/Transport/cURL.php
r38338 r38728 376 376 curl_setopt($this->handle, CURLOPT_REFERER, $url); 377 377 curl_setopt($this->handle, CURLOPT_USERAGENT, $options['useragent']); 378 curl_setopt($this->handle, CURLOPT_HTTPHEADER, $headers); 379 378 if (!empty($headers)) { 379 curl_setopt($this->handle, CURLOPT_HTTPHEADER, $headers); 380 } 380 381 if ($options['protocol_version'] === 1.1) { 381 382 curl_setopt($this->handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); … … 459 460 * @return integer Length of provided data 460 461 */ 461 p rotectedfunction stream_body($handle, $data) {462 public function stream_body($handle, $data) { 462 463 $this->hooks->dispatch('request.progress', array($data, $this->response_bytes, $this->response_byte_limit)); 463 464 $data_length = strlen($data); -
branches/4.6/src/wp-includes/Requests/Transport/fsockopen.php
r38049 r38728 71 71 if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https') { 72 72 $remote_socket = 'ssl://' . $host; 73 $url_parts['port'] = 443; 73 if (!isset($url_parts['port'])) { 74 $url_parts['port'] = 443; 75 } 74 76 75 77 $context_options = array( … … 98 100 99 101 if (isset($options['verifyname']) && $options['verifyname'] === false) { 102 $context_options['verify_peer_name'] = false; 100 103 $verifyname = false; 101 104 } … … 172 175 $out .= sprintf('Host: %s', $url_parts['host']); 173 176 174 if ( $url_parts['port'] !== 80) {177 if (( 'http' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 80 ) || ( 'https' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 443 )) { 175 178 $out .= ':' . $url_parts['port']; 176 179 } -
branches/4.6/src/wp-includes/class-http.php
r38485 r38728 333 333 if ( ! $r['sslverify'] ) { 334 334 $options['verify'] = false; 335 $options['verifyname'] = false; 335 336 } else { 336 337 $options['verify'] = $r['sslcertificates']; … … 362 363 } 363 364 } 364 365 // Work around a bug in Requests when the path starts with // See https://github.com/rmccue/Requests/issues/231366 $url = preg_replace( '!^(\w+://[^/]+)//(.*)$!i', '$1/$2', $url );367 365 368 366 try { -
branches/4.6/src/wp-includes/class-requests.php
r38163 r38728 750 750 */ 751 751 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))) { 753 753 return $data; 754 754 } 755 756 755 757 756 758 $decoded = ''; … … 758 760 759 761 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); 761 763 if (!$is_chunked) { 762 764 // Looks like it's not chunked after all
Note: See TracChangeset
for help on using the changeset viewer.