Ticket #4779: 4779.fix.reversed.encode.diff
| File 4779.fix.reversed.encode.diff, 1.1 KB (added by , 18 years ago) |
|---|
-
wp-includes/http.php
185 185 186 186 $r = wp_parse_args( $args, $defaults ); 187 187 188 if ( ! is_null($headers) && ! is_array($headers) ) { 188 if ( is_null($headers) ) 189 $headers = array(); 190 191 if ( ! is_array($headers) ) { 189 192 $processedHeaders = WP_Http::processHeaders($headers); 190 193 $headers = $processedHeaders['headers']; 191 } else {192 $headers = array();193 194 } 194 195 195 196 if ( ! isset($headers['user-agent']) || ! isset($headers['User-Agent']) ) 196 197 $headers['user-agent'] = $r['user-agent']; 197 198 198 199 if ( is_null($body) ) { 200 $transports = WP_Http::_getTransport(); 201 } else { 199 202 if ( is_array($body) || is_object($body) ) 200 203 $body = http_build_query($body); 201 204 202 $transports = WP_Http::_getTransport();203 } else204 205 $transports = WP_Http::_postTransport(); 206 } 205 207 206 208 $response = array( 'headers' => array(), 'body' => '', 'response' => array('code', 'message') ); 207 209 foreach( (array) $transports as $transport ) {