mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 15:47:38 +02:00
redirect fixes from ruckus and tellyworth. fixes #5479
git-svn-id: http://svn.automattic.com/wordpress/trunk@6402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
83ccac4372
commit
49d8db4cbe
@ -575,7 +575,7 @@ function wp_get_http( $url, $file_path = false, $red = 1 ) {
|
|||||||
$code = $headers['response'];
|
$code = $headers['response'];
|
||||||
if ( ( '302' == $code || '301' == $code ) && isset( $headers['location'] ) ) {
|
if ( ( '302' == $code || '301' == $code ) && isset( $headers['location'] ) ) {
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
return wp_get_http_headers( $headers['location'], $get, ++$red );
|
return wp_get_http( $headers['location'], $file_path, ++$red );
|
||||||
}
|
}
|
||||||
|
|
||||||
// make a note of the final location, so the caller can tell if we were redirected or not
|
// make a note of the final location, so the caller can tell if we were redirected or not
|
||||||
@ -605,8 +605,8 @@ function wp_get_http( $url, $file_path = false, $red = 1 ) {
|
|||||||
return $headers;
|
return $headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
function wp_get_http_headers( $url ) {
|
function wp_get_http_headers( $url, $red = 1 ) {
|
||||||
return wp_get_http( $url, false );
|
return wp_get_http( $url, false, $red );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user