error use of array_merge in http curl
muyline opened this issue · 3 comments
hi, thanks for the code, it help me a lot.
when i add proxy in the http curl,but it can not work, then i found the reason is that the Curl.php which path is 'comon/src/Http/Client/Curl.php'.
in the construct function
if ($parameters) { $this->parameters = array_merge($this->parameters, $parameters); }
, the array_merge change the array to a indexed array.
$this->parameters = $parameters + $this->parameters;
can fix it.
array (size=7) 64 => int 0 81 => int 0 61 => int 0 10004 => string '127.0.0.1' (length=9) 59 => string '1080' (length=4) 101 => int 7 13 => int 20
array (size=5) 10018 => string 'SocialConnect\Curl (https://github.com/socialconnect/common) v1.0' (length=65) 42 => boolean false 19913 => boolean true 78 => int 0 13 => int 30
when merged it like this
array (size=12) 0 => string 'SocialConnect\Curl (https://github.com/socialconnect/common) v1.0' (length=65) 1 => boolean false 2 => boolean true 3 => int 0 4 => int 30 5 => int 0 6 => int 0 7 => int 0 8 => string '127.0.0.1' (length=9) 9 => string '1080' (length=4) 10 => int 7 11 => int 20
Hey! Thank for bug reporting!
referenced commit with fix, SocialConnect/common@d001831
Package sociallconnect/common
released 1.0.3
with fix to this
Use composer update
:)
I am going to close issue, feel free to re-open if it's not fixed for your
Thanks, Have a nice day 😸
Thanks, I load the 1.0.3, it works well