Ticket #4779: 4779.encode.post.data.diff
File 4779.encode.post.data.diff, 1.2 KB (added by , 16 years ago) |
---|
-
wp-includes/http.php
170 170 * @param string $url URI resource. 171 171 * @param str|array $args Optional. Override the defaults. 172 172 * @param string|array $headers Optional. Either the header string or array of Header name and value pairs. Expects sanitized. 173 * @param string $body Optional. The body that should be sent. Expected to be alreadyprocessed.173 * @param string $body Optional. The body that should be sent. Will be automatically escaped and processed. 174 174 * @return boolean 175 175 */ 176 176 function request($url, $args = array(), $headers = null, $body = null) { … … 195 195 if ( ! isset($headers['user-agent']) || ! isset($headers['User-Agent']) ) 196 196 $headers['user-agent'] = $r['user-agent']; 197 197 198 if ( is_null($body) ) 198 if ( ! is_null($body) ) { 199 if ( ! is_string($body) ) 200 $body = http_build_query($body); 201 202 $transport = WP_Http::_postTransport(); 203 } else { 199 204 $transport = WP_Http::_getTransport(); 200 else 201 $transport = WP_Http::_postTransport(); 205 } 202 206 203 207 return $transport->request($url, $r, $headers, $body); 204 208 }