File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -371,15 +371,16 @@ private static function setUpRequestParams(array $data)
371
371
if (is_string ($ item ) && file_exists ($ item )) {
372
372
$ item = new Stream (self ::encodeFile ($ item ));
373
373
}
374
- } elseif (is_array ($ item )) {
375
- // Convert any nested arrays into JSON strings.
374
+ } elseif (is_array ($ item ) || is_object ( $ item ) ) {
375
+ // Convert any nested arrays or objects into JSON strings.
376
376
$ item = json_encode ($ item );
377
377
}
378
378
379
379
// Reformat data array in multipart way if it contains a resource
380
380
$ has_resource = $ has_resource || is_resource ($ item ) || $ item instanceof Stream;
381
381
$ multipart [] = ['name ' => $ key , 'contents ' => $ item ];
382
382
}
383
+ unset($ item );
383
384
384
385
if ($ has_resource ) {
385
386
return ['multipart ' => $ multipart ];
@@ -477,11 +478,6 @@ public static function getCurrentAction()
477
478
*/
478
479
public static function execute ($ action , array $ data = [])
479
480
{
480
- //Fix so that the keyboard markup is a string, not an object
481
- if (isset ($ data ['reply_markup ' ])) {
482
- $ data ['reply_markup ' ] = json_encode ($ data ['reply_markup ' ]);
483
- }
484
-
485
481
$ result = null ;
486
482
$ request_params = self ::setUpRequestParams ($ data );
487
483
$ request_params ['debug ' ] = TelegramLog::getDebugLogTempStream ();
You can’t perform that action at this time.
0 commit comments