Changeset 13151
- Timestamp:
- 02/14/2010 11:23:32 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r13148 r13151 1237 1237 * @param string $url URL to fetch. 1238 1238 * @param string|bool $file_path Optional. File path to write request to. 1239 * @param bool $deprecated Deprecated. Not used.1239 * @param int $red (private) The number of Redirects followed, Upon 5 being hit, returns false. 1240 1240 * @return bool|string False on failure and string of headers if HEAD request. 1241 1241 */ 1242 function wp_get_http( $url, $file_path = false, $deprecated = false ) { 1243 if ( !empty( $deprecated ) ) 1244 _deprecated_argument( __FUNCTION__, '2.7' ); 1245 1242 function wp_get_http( $url, $file_path = false, $red = 1 ) { 1246 1243 @set_time_limit( 60 ); 1244 1245 if ( $red > 5 ) 1246 return false; 1247 1247 1248 1248 $options = array(); … … 1261 1261 $headers = wp_remote_retrieve_headers( $response ); 1262 1262 $headers['response'] = $response['response']['code']; 1263 1264 // WP_HTTP no longer follows redirects for HEAD requests. 1265 if ( 'HEAD' == $options['method'] && in_array($headers['response'], array(301, 302)) && isset( $headers['location'] ) ) { 1266 return wp_get_http( $headers['location'], $file_path, ++$red ); 1267 } 1263 1268 1264 1269 if ( false == $file_path )
Note: See TracChangeset
for help on using the changeset viewer.