aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Christian Schabesberger <chris.schabesberger@mailbox.org> 2022-01-01 23:51:59 +0100
committerGravatar GitHub <noreply@github.com> 2022-01-02 03:51:59 +0500
commitfc51c6753d94fc859b8a35e170845dc11f03f63c (patch)
tree1a23325cad11e4ca474928f94852ec72d92ec438
parent71cd15c35db17246e4572c327ccc478c17f4f735 (diff)
downloadrss-bridge-fc51c6753d94fc859b8a35e170845dc11f03f63c.tar.gz
rss-bridge-fc51c6753d94fc859b8a35e170845dc11f03f63c.tar.zst
rss-bridge-fc51c6753d94fc859b8a35e170845dc11f03f63c.zip
[NordbayernBridge] Fix banner images (#2384)
-rw-r--r--bridges/NordbayernBridge.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/bridges/NordbayernBridge.php b/bridges/NordbayernBridge.php
index ba1671b2..770876fb 100644
--- a/bridges/NordbayernBridge.php
+++ b/bridges/NordbayernBridge.php
@@ -97,10 +97,11 @@ class NordbayernBridge extends BridgeAbstract {
// the first immage will be the portrait of the author
// and not the article banner. The banner in this
// case will be the second image.
- if ($article->find('div[class=authorinfo]', 0) == null) {
- $bannerUrl = $images[0];
+ // Also skip first image, as its always NN logo.
+ if ($article->find('a[id="openAuthor"]', 0) == null) {
+ $bannerUrl = isset($images[1]) ? $images[1] : null;
} else {
- $bannerUrl = $images[1];
+ $bannerUrl = isset($images[2]) ? $images[2] : null;
}
$item['content'] .= '<img src="' . $bannerUrl . '">';
@@ -116,7 +117,7 @@ class NordbayernBridge extends BridgeAbstract {
$item['content'] .= self::getUseFullContent($content);
}
- for($i = 0; $i < count($images); $i++) {
+ for($i = 1; $i < count($images); $i++) {
$item['content'] .= '<img src="' . $images[$i] . '">';
}