WordPress.org

Make WordPress Core

Changeset 12747


Ignore:
Timestamp:
01/17/2010 08:15:52 AM (11 years ago)
Author:
dd32
Message:

Allow cURL to follow redirects when running under safe_mode or open_basedir. See #11305

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/http.php

    r12746 r12747  
    13971397        if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($theHeaders['headers']) )
    13981398            $theBody = WP_Http_Encoding::decompress( $theBody );
     1399
     1400        // See #11605 - When running under safe mode, redirection is disabled above. Handle it manually.
     1401        if ( !empty($theHeaders['headers']['location']) && (ini_get('safe_mode') || ini_get('open_basedir')) ) {
     1402            if ( $r['redirection']-- > 0 ) {
     1403                return $this->request($theHeaders['headers']['location'], $r);
     1404            } else {
     1405                return new WP_Error('http_request_failed', __('Too many redirects.'));
     1406            }
     1407        }
    13991408
    14001409        return array('headers' => $theHeaders['headers'], 'body' => $theBody, 'response' => $response, 'cookies' => $theHeaders['cookies']);
Note: See TracChangeset for help on using the changeset viewer.