[AssociatedPressNews] fix: prepend lead photo to items (#2905)

This commit is contained in:
Dag 2022-07-08 18:42:45 +02:00 committed by GitHub
parent f672902896
commit c992bcc8bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -149,8 +149,11 @@ class AssociatedPressNewsBridge extends BridgeAbstract
$this->processIframes($html);
if (!is_null($storyContent['leadPhotoId'])) {
$item['enclosures'][] = 'https://storage.googleapis.com/afs-prod/media/'
. $storyContent['leadPhotoId'] . '/800.jpeg';
$leadPhotoUrl = sprintf('https://storage.googleapis.com/afs-prod/media/%s/800.jpeg', $storyContent['leadPhotoId']);
$leadPhotoImageTag = sprintf('<img src="%s">', $leadPhotoUrl);
// Move the image to the beginning of the content
$html = $leadPhotoImageTag . $html;
// Explicitly not adding it to the item's enclosures!
}
}