Changeset 23607 for trunk/wp-includes/class-http.php
- Timestamp:
- 03/04/2013 04:47:39 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/class-http.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-http.php
r23605 r23607 1207 1207 if ( ! $r['blocking'] ) { 1208 1208 curl_exec( $handle ); 1209 1210 if ( $curl_error = curl_error( $handle ) ) { 1211 curl_close( $handle ); 1212 return new WP_Error( 'http_request_failed', $curl_error ); 1213 } 1214 if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) ) { 1215 curl_close( $handle ); 1216 return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) ); 1217 } 1218 1209 1219 curl_close( $handle ); 1210 1220 return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); … … 1220 1230 // If no response 1221 1231 if ( 0 == strlen( $theBody ) && empty( $theHeaders['headers'] ) ) { 1222 if ( $curl_error = curl_error( $handle ) ) 1232 if ( $curl_error = curl_error( $handle ) ) { 1233 curl_close( $handle ); 1223 1234 return new WP_Error( 'http_request_failed', $curl_error ); 1224 if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) ) 1235 } 1236 if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) ) { 1237 curl_close( $handle ); 1225 1238 return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) ); 1239 } 1226 1240 } 1227 1241
Note: See TracChangeset
for help on using the changeset viewer.