Merge pull request #1040 from MrPetovan/bug/9447-twitter-parse-url-dimensions

[twitter] Add expected dimensions in parse_url hook function
pull/1041/head
Michael Vogel 2020-11-05 07:30:32 +01:00 committed by GitHub
commit 0dce0b722b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -935,7 +935,11 @@ function twitter_parse_link(App $a, array &$b)
if ($b['format'] == 'json') { if ($b['format'] == 'json') {
if (!empty($status->extended_entities->media[0]->media_url_https)) { if (!empty($status->extended_entities->media[0]->media_url_https)) {
$images = [['src' => $status->extended_entities->media[0]->media_url_https]]; $images = [[
'src' => $status->extended_entities->media[0]->media_url_https,
'width' => $status->extended_entities->media[0]->sizes->thumb->w,
'height' => $status->extended_entities->media[0]->sizes->thumb->h,
]];
} }
$b['text'] = [ $b['text'] = [