WordPress.org

Make WordPress Core

Ticket #11305: 11305.diff

File 11305.diff, 823 bytes (added by dd32, 11 years ago)

Updated patch based on Fsockopen's syntax, to keep the logic constant throughout the file.

  • wp-includes/http.php

     
    13761385                        $theBody = '';
    13771386                }
    13781387
     1388                // See #11605 - When running under safe mode, Redirection is disabled above. Handle it manually.
     1389                if ( !empty($theHeaders['headers']['location']) && (ini_get('safe_mode') || ini_get('open_basedir')) ) {
     1390                        if ( $r['redirection']-- > 0 ) {
     1391                                return $this->request($theHeaders['headers']['location'], $r);
     1392                        } else {
     1393                                return new WP_Error('http_request_failed', __('Too many redirects.'));
     1394                        }
     1395                }
     1396
    13791397                $response = array();
    13801398                $response['code'] = curl_getinfo( $handle, CURLINFO_HTTP_CODE );
    13811399                $response['message'] = get_status_header_desc($response['code']);