File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ function http_build_multi_query($data, $key=NULL) {
87
87
$ is_array_assoc = is_array_assoc ($ data );
88
88
89
89
foreach ($ data as $ k => $ value ) {
90
- if (is_string ($ value ) || is_int ($ value )) {
90
+ if (is_string ($ value ) || is_numeric ($ value )) {
91
91
$ brackets = $ is_array_assoc ? '[ ' . $ k . '] ' : '[] ' ;
92
92
$ query [] = urlencode (is_null ($ key ) ? $ k : $ key . $ brackets ) . '= ' . rawurlencode ($ value );
93
93
}
Original file line number Diff line number Diff line change @@ -68,9 +68,10 @@ public function testPostAssociativeArrayData() {
68
68
'more_data ' => array (
69
69
'param1 ' => 'something ' ,
70
70
'param2 ' => 'other thing ' ,
71
- 'param3 ' => '123 ' ,
71
+ 'param3 ' => 123 ,
72
+ 'param4 ' => 3.14 ,
72
73
),
73
- )) === 'test=post_multidimensional&username=myusername&password=mypassword&more_data%5Bparam1%5D=something&more_data%5Bparam2%5D=other%20thing&more_data%5Bparam3%5D=123 ' );
74
+ )) === 'test=post_multidimensional&username=myusername&password=mypassword&more_data%5Bparam1%5D=something&more_data%5Bparam2%5D=other%20thing&more_data%5Bparam3%5D=123&more_data%5Bparam4%5D=3.14 ' );
74
75
}
75
76
76
77
public function testPostMultidimensionalData () {
You can’t perform that action at this time.
0 commit comments