From d4b814df2f31a42ca28d4bb5093867af549c3b69 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 4 Mar 2013 05:17:05 +0000 Subject: [PATCH] WP_HTTP: Fix returning WP_Error's on too-many-redirects after r23603 See #23682 git-svn-id: http://core.svn.wordpress.org/trunk@23608 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-http.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index 4ad0d5f446..5650b68df2 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -109,8 +109,9 @@ class WP_Http { $r = wp_parse_args( $args, $defaults ); $r = apply_filters( 'http_request_args', $r, $url ); - // Certain classes decrement this, store a copy of the original value for loop purposes. - $r['_redirection'] = $r['redirection']; + // The transports decrement this, store a copy of the original value for loop purposes. + if ( ! isset( $r['_redirection'] ) ) + $r['_redirection'] = $r['redirection']; // Allow plugins to short-circuit the request $pre = apply_filters( 'pre_http_request', false, $r, $url );