Enclosure redirect fix from aegrumet. fixes #2551
git-svn-id: https://develop.svn.wordpress.org/trunk@3793 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a868cae733
commit
add8a92036
@ -964,15 +964,13 @@ function wp_get_http_headers( $url, $red = 1 ) {
|
|||||||
$headers["$key"] = $matches[2][$i];
|
$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);
|
preg_match('/.*([0-9]{3}).*/', $response, $return);
|
||||||
$headers['response'] = $return[1]; // HTTP response code eg 204, 200, 404
|
$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;
|
return $headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user