Make WordPress Core

Ticket #17588: 17588.diff

File 17588.diff, 738 bytes (added by kovshenin, 13 years ago)
  • wp-includes/class-http.php

     
    800800                // If location is found, then assume redirect and redirect to location.
    801801                if ( isset($arrHeaders['headers']['location']) && 0 !== $r['_redirection'] ) {
    802802                        if ( $r['redirection']-- > 0 ) {
     803                                if ( in_array( $arrHeaders['response']['code'], array( 302, 303 ) ) && 'POST' == $r['method'] )
     804                                        $r['method'] = 'GET';
     805
    803806                                return wp_remote_request( WP_HTTP::make_absolute_url( $arrHeaders['headers']['location'], $url ), $r);
    804807                        } else {
    805808                                return new WP_Error('http_request_failed', __('Too many redirects.'));