aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Dag <me@dvikan.no> 2022-07-08 18:42:45 +0200
committerGravatar GitHub <noreply@github.com> 2022-07-08 18:42:45 +0200
commitc992bcc8bf0a5abbc9ea897acc7d98520763313d (patch)
tree705bc82452a33d0ecb288067413fe8cd2fed2da8
parentf672902896e71db8f6f06c557be6f701e31b6e7a (diff)
downloadrss-bridge-c992bcc8bf0a5abbc9ea897acc7d98520763313d.tar.gz
rss-bridge-c992bcc8bf0a5abbc9ea897acc7d98520763313d.tar.zst
rss-bridge-c992bcc8bf0a5abbc9ea897acc7d98520763313d.zip
[AssociatedPressNews] fix: prepend lead photo to items (#2905)
-rw-r--r--bridges/AssociatedPressNewsBridge.php7
1 files 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('<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!
}
}