Fix PHP 7.0 Coding Standards

This commit is contained in:
Philipp 2021-05-22 23:45:15 +02:00
parent 83cb4edc36
commit 965cd8b096
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
8 changed files with 16 additions and 15 deletions

View file

@ -1186,12 +1186,12 @@ function api_statuses_update($type)
INNER JOIN `user` ON `user`.`uid` = `photo`.`uid` WHERE `resource-id` IN
(SELECT `resource-id` FROM `photo` WHERE `id` = ?) AND `photo`.`uid` = ?
ORDER BY `photo`.`width` DESC LIMIT 2", $id, api_user()));
if (!empty($media)) {
$ressources[] = $media[0]['resource-id'];
$phototypes = Images::supportedTypes();
$ext = $phototypes[$media[0]['type']];
$attachment = ['type' => Post\Media::IMAGE, 'mimetype' => $media[0]['type'],
'url' => DI::baseUrl() . '/photo/' . $media[0]['resource-id'] . '-' . $media[0]['scale'] . '.' . $ext,
'size' => $media[0]['datasize'],
@ -1199,7 +1199,7 @@ function api_statuses_update($type)
'description' => $media[0]['desc'] ?? '',
'width' => $media[0]['width'],
'height' => $media[0]['height']];
if (count($media) > 1) {
$attachment['preview'] = DI::baseUrl() . '/photo/' . $media[1]['resource-id'] . '-' . $media[1]['scale'] . '.' . $ext;
$attachment['preview-width'] = $media[1]['width'];