From c992bcc8bf0a5abbc9ea897acc7d98520763313d Mon Sep 17 00:00:00 2001 From: Dag Date: Fri, 8 Jul 2022 18:42:45 +0200 Subject: [PATCH] [AssociatedPressNews] fix: prepend lead photo to items (#2905) --- bridges/AssociatedPressNewsBridge.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bridges/AssociatedPressNewsBridge.php b/bridges/AssociatedPressNewsBridge.php index 6d686312..0f8846eb 100644 --- a/bridges/AssociatedPressNewsBridge.php +++ b/bridges/AssociatedPressNewsBridge.php @@ -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('', $leadPhotoUrl); + // Move the image to the beginning of the content + $html = $leadPhotoImageTag . $html; + // Explicitly not adding it to the item's enclosures! } }