Skip to content

Commit 489df24

Browse files
author
Dani Sanchez
committed
Fixes issue php-curl-class#8 "Nested arrays in data array are encoded at the same level as it's father array"
Makes the http_build_multi_query method to persist nested array indexes inside the data array Signed-off-by: Dani Sancas <dani@sancas.es>
1 parent 74b123f commit 489df24

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Curl.class.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ function http_build_multi_query($data, $key=NULL) {
9292
$query[] = urlencode(is_null($key) ? $k : $key . $brackets) . '=' . rawurlencode($value);
9393
}
9494
else if (is_array($value)) {
95-
$query[] = $this->http_build_multi_query($value, $k);
95+
$nested = (is_null($key)) ? $k : $key."[".$k."]";
96+
$query[] = $this->http_build_multi_query($value, $nested);
9697
}
9798
}
9899

0 commit comments

Comments
 (0)