Changeset 2956
- Timestamp:
- 10/19/2005 06:09:23 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r2942 r2956 926 926 } 927 927 928 function wp_get_http_headers( $url ) {928 function wp_get_http_headers( $url, $red = 1 ) { 929 929 global $wp_version; 930 930 @set_time_limit( 60 ); 931 932 if ( $red > 5 ) 933 return false; 934 931 935 $parts = parse_url( $url ); 932 936 $file = $parts['path'] . ($parts['query'] ? '?'.$parts['query'] : ''); … … 952 956 $headers["$key"] = $matches[2][$i]; 953 957 } 958 959 $code = preg_replace('/.*?(\d{3}).*/i', '$1', $response); 960 961 $headers['status_code'] = $code; 962 963 if ( '302' == $code || '301' == $code ) 964 return wp_get_http_headers( $url, ++$red ); 954 965 955 966 preg_match('/.*([0-9]{3}).*/', $response, $return);
Note: See TracChangeset
for help on using the changeset viewer.