WordPress.org

Make WordPress Core

Changeset 19000


Ignore:
Timestamp:
10/19/11 04:48:00 (4 years ago)
Author:
dd32
Message:

Respect the Content-Type header developers pass to WP_HTTP. Fixes #18982

File:
1 edited

Legend:

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

    r18806 r19000  
    181181            if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) { 
    182182                $r['body'] = http_build_query( $r['body'], null, '&' ); 
    183                 $r['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=' . get_option( 'blog_charset' ); 
     183                if ( ! isset( $r['headers']['Content-Type'] ) ) 
     184                    $r['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=' . get_option( 'blog_charset' ); 
    184185                $r['headers']['Content-Length'] = strlen( $r['body'] ); 
    185186            } 
Note: See TracChangeset for help on using the changeset viewer.