Changeset 38727
- Timestamp:
- 10/05/2016 03:23:54 AM (8 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/Requests/IRI.php
r38049 r38727 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 && -
trunk/src/wp-includes/Requests/Transport/cURL.php
r38274 r38727 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); -
trunk/src/wp-includes/Requests/Transport/fsockopen.php
r38049 r38727 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 } -
trunk/src/wp-includes/class-http.php
r38470 r38727 329 329 if ( ! $r['sslverify'] ) { 330 330 $options['verify'] = false; 331 $options['verifyname'] = false; 331 332 } else { 332 333 $options['verify'] = $r['sslcertificates']; … … 358 359 } 359 360 } 360 361 // Work around a bug in Requests when the path starts with // See https://github.com/rmccue/Requests/issues/231362 $url = preg_replace( '!^(\w+://[^/]+)//(.*)$!i', '$1/$2', $url );363 361 364 362 try { -
trunk/src/wp-includes/class-requests.php
r38163 r38727 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.