Skip to content

Commit 13a57be

Browse files
committed
fix for ultipe redirection modifcation of unknown variable
1 parent 07e7b8c commit 13a57be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

php-binance-api.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ public function keepAlive()
19861986
{
19871987
$loop = \React\EventLoop\Factory::create();
19881988
$loop->addPeriodicTimer(30, function () {
1989-
$listenKey = $this->options['listenKey'];
1989+
$listenKey = $this->listenKey;
19901990
$this->httpRequest("v1/userDataStream?listenKey={$listenKey}", "PUT", []);
19911991
});
19921992
$loop->run();
@@ -2033,15 +2033,15 @@ public function keepAlive()
20332033
public function userData(&$balance_callback, &$execution_callback = false)
20342034
{
20352035
$response = $this->httpRequest("v1/userDataStream", "POST", []);
2036-
$listenKey = $this->options['listenKey'] = $response['listenKey'];
2036+
$this->listenKey = $response['listenKey'];
20372037
$this->info['balanceCallback'] = $balance_callback;
20382038
$this->info['executionCallback'] = $execution_callback;
20392039

20402040
$this->subscriptions['@userdata'] = true;
20412041

20422042
// @codeCoverageIgnoreStart
20432043
// phpunit can't cover async function
2044-
\Ratchet\Client\connect($this->stream . $listenKey)->then(function ($ws) {
2044+
\Ratchet\Client\connect($this->stream . $this->listenKey)->then(function ($ws) {
20452045
$ws->on('message', function ($data) use ($ws) {
20462046
if ($this->subscriptions['@userdata'] === false) {
20472047
//$this->subscriptions[$endpoint] = null;

0 commit comments

Comments
 (0)