### Eclipse Workspace Patch 1.0
#P wordpress-trunk
|
|
|
|
| 102 | 102 | 'filename' => null |
| 103 | 103 | ); |
| 104 | 104 | |
| 105 | | |
| 106 | 105 | // Pre-parse for the HEAD checks. |
| 107 | 106 | $args = wp_parse_args( $args ); |
| 108 | 107 | |
| … |
… |
|
| 861 | 860 | if ( ! empty($r['body'] ) ) |
| 862 | 861 | $arrContext['http']['content'] = $r['body']; |
| 863 | 862 | |
| | 863 | // timeouts with stream_contect_create for some reason need to be half of what you expect |
| | 864 | $arrContext['http']['timeout'] = $r['timeout'] / 2; |
| | 865 | |
| 864 | 866 | $context = stream_context_create($arrContext); |
| 865 | 867 | |
| 866 | 868 | if ( !WP_DEBUG ) |
| … |
… |
|
| 908 | 910 | else |
| 909 | 911 | $processedHeaders = WP_Http::processHeaders($meta['wrapper_data']); |
| 910 | 912 | |
| 911 | | // Streams does not provide an error code which we can use to see why the request stream stoped. |
| | 913 | // Streams does not provide an error code which we can use to see why the request stream stoped. |
| 912 | 914 | // We can however test to see if a location header is present and return based on that. |
| 913 | 915 | if ( isset($processedHeaders['headers']['location']) && 0 !== $args['_redirection'] ) |
| 914 | 916 | return new WP_Error('http_request_failed', __('Too many redirects.')); |