From bc0c67ff87b4162c1a210da8093899519f6e1906 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sun, 17 Jan 2010 09:31:37 +0000 Subject: [PATCH] Fix Typo in r12747, Move cURL Redirection check higher. See #11305 git-svn-id: https://develop.svn.wordpress.org/trunk@12749 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/http.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/http.php b/wp-includes/http.php index 2bb08d5800..ddfba45c29 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -1416,10 +1416,7 @@ class WP_Http_Curl { curl_close( $handle ); - if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($theHeaders['headers']) ) - $theBody = WP_Http_Encoding::decompress( $theBody ); - - // See #11605 - When running under safe mode, redirection is disabled above. Handle it manually. + // See #11305 - When running under safe mode, redirection is disabled above. Handle it manually. if ( !empty($theHeaders['headers']['location']) && (ini_get('safe_mode') || ini_get('open_basedir')) ) { if ( $r['redirection']-- > 0 ) { return $this->request($theHeaders['headers']['location'], $r); @@ -1428,6 +1425,9 @@ class WP_Http_Curl { } } + if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($theHeaders['headers']) ) + $theBody = WP_Http_Encoding::decompress( $theBody ); + return array('headers' => $theHeaders['headers'], 'body' => $theBody, 'response' => $response, 'cookies' => $theHeaders['cookies']); }