Ticket #24156: send_filedata_curl.diff
File send_filedata_curl.diff, 1.2 KB (added by , 12 years ago) |
---|
-
class-http.php
171 171 172 172 if ( ( ! is_null( $r['body'] ) && '' != $r['body'] ) || 'POST' == $r['method'] || 'PUT' == $r['method'] ) { 173 173 if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) { 174 $r['body'] = http_build_query( $r['body'], null, '&' ); 175 174 if ( ! ( isset($r['headers']['Content-Type'] ) && $r['headers']['Content-Type'] == 'multipart/form-data' ) ) { 175 $r['body'] = http_build_query( $r['body'], null, '&' ); 176 } 176 177 if ( ! isset( $r['headers']['Content-Type'] ) ) 177 178 $r['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=' . get_option( 'blog_charset' ); 178 179 } … … 180 181 if ( '' === $r['body'] ) 181 182 $r['body'] = null; 182 183 183 if ( ! isset( $r['headers']['Content-Length'] ) && ! isset( $r['headers']['content-length'] ) )184 if ( ! isset( $r['headers']['Content-Length'] ) && ! isset( $r['headers']['content-length'] ) && is_string( $r['body'] ) ) 184 185 $r['headers']['Content-Length'] = strlen( $r['body'] ); 185 186 } 186 187