Fix posting pictures

This commit is contained in:
Michael 2021-11-29 18:03:34 +00:00
parent 6bd9c9f496
commit e7e74819a3

View file

@ -56,7 +56,7 @@ class Update extends BaseApi
'in_reply_to_status_id' => 0, 'in_reply_to_status_id' => 0,
'lat' => 0, 'lat' => 0,
'long' => 0, 'long' => 0,
'media_ids' => [], 'media_ids' => '',
'source' => '', 'source' => '',
'include_entities' => false, 'include_entities' => false,
], $request); ], $request);
@ -127,9 +127,9 @@ class Update extends BaseApi
$item['object-type'] = Activity\ObjectType::NOTE; $item['object-type'] = Activity\ObjectType::NOTE;
} }
$ids = $request['media_ids']; if (!empty($_REQUEST['media_ids'])) {
$ids = explode(',', $_REQUEST['media_ids']);
if (!empty($_FILES['media'])) { } elseif (!empty($_FILES['media'])) {
// upload the image if we have one // upload the image if we have one
$picture = Photo::upload($uid, $_FILES['media']); $picture = Photo::upload($uid, $_FILES['media']);
if (!empty($picture)) { if (!empty($picture)) {