@@ -1908,7 +1908,7 @@ protected function _getEndpoint($method, $method_template)
1908
1908
$ url = self ::$ _endpoint_media . $ method . '.json ' ;
1909
1909
} elseif ($ variant = $ this ->_detectStreaming ($ method_template )) {
1910
1910
$ url = self ::$ _endpoints_streaming [$ variant ] . $ method . '.json ' ;
1911
- } elseif ($ variant = $ this ->_detectBinaryBody ($ method_template )) {
1911
+ } elseif ($ this ->_detectBinaryBody ($ method_template )) {
1912
1912
$ url = self ::$ _endpoint_ton . $ method ;
1913
1913
} elseif (substr ($ method_template , 0 , 12 ) === 'ads/sandbox/ ' ) {
1914
1914
$ url = self ::$ _endpoint_ads_sandbox . substr ($ method , 12 );
@@ -2167,6 +2167,9 @@ protected function _callApiPreparationsPost(
2167
2167
}
2168
2168
$ sign_params = [];
2169
2169
parse_str (parse_url ($ method , PHP_URL_QUERY ), $ sign_params );
2170
+ if ($ sign_params === null ) {
2171
+ $ sign_params = [];
2172
+ }
2170
2173
$ authorization = $ this ->_sign ($ httpmethod , $ url , $ sign_params );
2171
2174
if (isset ($ params ['media ' ])) {
2172
2175
$ params = $ this ->_buildBinaryBody ($ params ['media ' ]);
@@ -2261,7 +2264,7 @@ protected function _callApiStreaming(
2261
2264
2262
2265
list ($ authorization , $ url , $ params , $ request_headers )
2263
2266
= $ this ->_callApiPreparations (
2264
- $ httpmethod , $ method , $ params , false , $ app_only_auth
2267
+ $ httpmethod , $ method , $ method_template , $ params , false , $ app_only_auth
2265
2268
);
2266
2269
2267
2270
$ hostname = parse_url ($ url , PHP_URL_HOST );
0 commit comments