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