Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
ignore feed items with invalid permalink schemes
  • Loading branch information
Guite committed Sep 20, 2021
1 parent 14ee49c commit 0e83566
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/extensions/Zikula/ContentModule/ContentType/FeedType.php
Expand Up @@ -90,6 +90,9 @@ public function displayView(): string
if (count($items) >= $this->data['maxNoOfItems']) {
break;
}
if ('http' !== mb_substr($item->get_permalink(), 0, 4)) {
continue;
}

$items[] = [
'title' => $this->decode($item->get_title(), $feedEncoding),
Expand All @@ -101,7 +104,7 @@ public function displayView(): string
$this->data['feed'] = [
'title' => $this->decode($feed->get_title(), $feedEncoding),
'description' => strip_tags(html_entity_decode($this->decode($feed->get_description() ?? '', $feedEncoding))),
'permalink' => $feed->get_permalink(),
'permalink' => 'http' === mb_substr($feed->get_permalink(), 0, 4) ? $feed->get_permalink() : '',
'items' => $items,
];

Expand Down

0 comments on commit 0e83566

Please sign in to comment.