Ticket #4779: 4779.encode.post.data.2.diff
File 4779.encode.post.data.2.diff, 1.4 KB (added by , 13 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) { … … 188 188 if ( ! is_null($headers) && ! is_array($headers) ) { 189 189 $processedHeaders = WP_Http::processHeaders($headers); 190 190 $headers = $processedHeaders['headers']; 191 } else {192 $headers = array();193 191 } 194 192 195 193 if ( ! isset($headers['user-agent']) || ! isset($headers['User-Agent']) ) 196 194 $headers['user-agent'] = $r['user-agent']; 197 195 198 if ( is_null($body) ) 196 if ( ! is_null($body) ) { 197 if ( ! is_string($body) ) 198 $body = http_build_query($body); 199 200 $transport = WP_Http::_postTransport(); 201 } else { 199 202 $transport = WP_Http::_getTransport(); 200 else 201 $transport = WP_Http::_postTransport(); 203 } 202 204 203 205 return $transport->request($url, $r, $headers, $body); 204 206 }