@@ -136,16 +136,14 @@ public function beforeSend($callback)
136
136
public function buildPostData ($ data )
137
137
{
138
138
if (is_array ($ data )) {
139
- if (self ::is_array_multidim ($ data )) {
140
- if (isset ($ this ->headers ['Content-Type ' ]) &&
141
- preg_match ($ this ->jsonPattern , $ this ->headers ['Content-Type ' ])) {
142
- $ json_str = json_encode ($ data );
143
- if (!($ json_str === false )) {
144
- $ data = $ json_str ;
145
- }
146
- } else {
147
- $ data = self ::http_build_multi_query ($ data );
139
+ if (isset ($ this ->headers ['Content-Type ' ]) &&
140
+ preg_match ($ this ->jsonPattern , $ this ->headers ['Content-Type ' ])) {
141
+ $ json_str = json_encode ($ data );
142
+ if (!($ json_str === false )) {
143
+ $ data = $ json_str ;
148
144
}
145
+ } else if (self ::is_array_multidim ($ data )) {
146
+ $ data = self ::http_build_multi_query ($ data );
149
147
} else {
150
148
$ binary_data = false ;
151
149
foreach ($ data as $ key => $ value ) {
@@ -166,15 +164,7 @@ public function buildPostData($data)
166
164
}
167
165
168
166
if (!$ binary_data ) {
169
- if (isset ($ this ->headers ['Content-Type ' ]) &&
170
- preg_match ($ this ->jsonPattern , $ this ->headers ['Content-Type ' ])) {
171
- $ json_str = json_encode ($ data );
172
- if (!($ json_str === false )) {
173
- $ data = $ json_str ;
174
- }
175
- } else {
176
- $ data = http_build_query ($ data , '' , '& ' );
177
- }
167
+ $ data = http_build_query ($ data , '' , '& ' );
178
168
}
179
169
}
180
170
}
@@ -988,7 +978,7 @@ public function unsetHeader($key)
988
978
* @param bool $on
989
979
* @param resource $output
990
980
*/
991
- public function verbose ($ on = true , $ output= STDERR )
981
+ public function verbose ($ on = true , $ output = STDERR )
992
982
{
993
983
// Turn off CURLINFO_HEADER_OUT for verbose to work. This has the side
994
984
// effect of causing Curl::requestHeaders to be empty.
0 commit comments