Skip to content

Commit

Permalink
Enclosure redirect fix from aegrumet. fixes #2551
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@3792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
ryan committed May 26, 2006
1 parent 58bf75d commit 1204f35
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions wp-includes/functions.php
Expand Up @@ -1091,15 +1091,13 @@ function wp_get_http_headers( $url, $red = 1 ) {
$headers["$key"] = $matches[2][$i];
}

$code = preg_replace('/.*?(\d{3}).*/i', '$1', $response);

$headers['status_code'] = $code;

if ( '302' == $code || '301' == $code )
return wp_get_http_headers( $url, ++$red );

preg_match('/.*([0-9]{3}).*/', $response, $return);
$headers['response'] = $return[1]; // HTTP response code eg 204, 200, 404

$code = $headers['response'];
if ( ('302' == $code || '301' == $code) && isset($headers['location']) )
return wp_get_http_headers( $headers['location'], ++$red );

return $headers;
}

Expand Down

0 comments on commit 1204f35

Please sign in to comment.