WordPress.org

Make WordPress Core

Ticket #16888: 16888.patch

File 16888.patch, 707 bytes (added by hakre, 3 years ago)

3xx instead of 301 and 302 only.

  • wp-includes/class-http.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress-trunk
     
    14341434                } else { 
    14351435                        if ( $curl_error = curl_error($handle) ) 
    14361436                                return new WP_Error('http_request_failed', $curl_error); 
    1437                         if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array(301, 302) ) ) 
     1437                        if ( '3' === substr( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), 0, 1 ) ) 
    14381438                                return new WP_Error('http_request_failed', __('Too many redirects.')); 
    14391439 
    14401440                        $theHeaders = array( 'headers' => array(), 'cookies' => array() );