Skip to content

Commit 4bd9d23

Browse files
committed
Fix issues
1 parent 7f2f9e5 commit 4bd9d23

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/codebird.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,7 +1908,7 @@ protected function _getEndpoint($method, $method_template)
19081908
$url = self::$_endpoint_media . $method . '.json';
19091909
} elseif ($variant = $this->_detectStreaming($method_template)) {
19101910
$url = self::$_endpoints_streaming[$variant] . $method . '.json';
1911-
} elseif ($variant = $this->_detectBinaryBody($method_template)) {
1911+
} elseif ($this->_detectBinaryBody($method_template)) {
19121912
$url = self::$_endpoint_ton . $method;
19131913
} elseif (substr($method_template, 0, 12) === 'ads/sandbox/') {
19141914
$url = self::$_endpoint_ads_sandbox . substr($method, 12);
@@ -2167,6 +2167,9 @@ protected function _callApiPreparationsPost(
21672167
}
21682168
$sign_params = [];
21692169
parse_str(parse_url($method, PHP_URL_QUERY), $sign_params);
2170+
if ($sign_params === null) {
2171+
$sign_params = [];
2172+
}
21702173
$authorization = $this->_sign($httpmethod, $url, $sign_params);
21712174
if (isset($params['media'])) {
21722175
$params = $this->_buildBinaryBody($params['media']);
@@ -2261,7 +2264,7 @@ protected function _callApiStreaming(
22612264

22622265
list ($authorization, $url, $params, $request_headers)
22632266
= $this->_callApiPreparations(
2264-
$httpmethod, $method, $params, false, $app_only_auth
2267+
$httpmethod, $method, $method_template, $params, false, $app_only_auth
22652268
);
22662269

22672270
$hostname = parse_url($url, PHP_URL_HOST);

0 commit comments

Comments
 (0)