Changeset 10321 for branches/2.7/wp-includes/http.php
- Timestamp:
- 01/06/2009 05:30:41 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.7/wp-includes/http.php
r10310 r10321 243 243 244 244 if ( is_null($r['body']) ) { 245 // Some servers fail when sending content without the content-length 246 // header being set. 245 247 $r['headers']['Content-Length'] = 0; 246 248 $transports = WP_Http::_getTransport($r); … … 640 642 return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url)); 641 643 642 if ( 'http' != $arrURL['scheme'] ||'https' != $arrURL['scheme'] )644 if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] ) 643 645 $url = str_replace($arrURL['scheme'], 'http', $url); 644 646 … … 773 775 $context = stream_context_create($arrContext); 774 776 775 if ( ! defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )777 if ( ! defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) ) 776 778 $handle = @fopen($url, 'r', false, $context); 777 779 else … … 978 980 } 979 981 980 // If timeout is a float less than 1, round it up to 1. 982 // cURL extension will sometimes fail when the timeout is less than 1 as 983 // it may round down to 0, which gives it unlimited timeout. 981 984 if ( $r['timeout'] > 0 && $r['timeout'] < 1 ) 982 985 $r['timeout'] = 1; … … 985 988 curl_setopt( $handle, CURLOPT_URL, $url); 986 989 990 // The cURL extension requires that the option be set for the HEAD to 991 // work properly. 987 992 if ( 'HEAD' === $r['method'] ) { 988 993 curl_setopt( $handle, CURLOPT_NOBODY, true ); … … 1003 1008 curl_setopt( $handle, CURLOPT_MAXREDIRS, $r['redirection'] ); 1004 1009 1010 // The option doesn't work with safe mode or when open_basedir is set. 1005 1011 if ( !ini_get('safe_mode') && !ini_get('open_basedir') ) 1006 1012 curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, true );
Note: See TracChangeset
for help on using the changeset viewer.