diff --git a/administrator/modules/mod_feed/tmpl/default.php b/administrator/modules/mod_feed/tmpl/default.php index 12fd8ec81b25a..5217cdca8ba2b 100644 --- a/administrator/modules/mod_feed/tmpl/default.php +++ b/administrator/modules/mod_feed/tmpl/default.php @@ -83,20 +83,20 @@ if (!$feed->offsetExists($i)) : break; endif; - $uri = (!empty($feed[$i]->uri) || !is_null($feed[$i]->uri)) ? $feed[$i]->uri : $feed[$i]->guid; - $uri = substr($uri, 0, 4) != 'http' ? $params->get('rsslink') : $uri; - $text = !empty($feed[$i]->content) || !is_null($feed[$i]->content) ? $feed[$i]->content : $feed[$i]->description; + $uri = $feed[$i]->uri || !$feed[$i]->isPermaLink ? trim($feed[$i]->uri) : trim($feed[$i]->guid); + $uri = !$uri || stripos($uri, 'http') !== 0 ? $params->get('rsslink') : $uri; + $text = $feed[$i]->content !== '' ? trim($feed[$i]->content) : ''; ?>
  • + title); ?> - - + + - get('rssitemdesc') && !empty($text)) : ?> + get('rssitemdesc') && $text !== '') : ?>
    rssDoc[$i])) : ?> - rssDoc[$i]->guid) || $this->rssDoc[$i]->guid !== null ? trim($this->rssDoc[$i]->guid) : trim($this->rssDoc[$i]->uri); ?> - item->link : $uri; ?> - rssDoc[$i]->content) || $this->rssDoc[$i]->content !== null ? trim($this->rssDoc[$i]->content) : trim($this->rssDoc[$i]->description); ?> - rssDoc[$i]->title); ?> + rssDoc[$i]->uri || !$this->rssDoc[$i]->isPermaLink ? trim($this->rssDoc[$i]->uri) : trim($this->rssDoc[$i]->guid); ?> + item->link : $uri; ?> + rssDoc[$i]->content !== '' ? trim($this->rssDoc[$i]->content) : ''; ?>
  • - + - params->get('show_item_description') && !empty($text)) : ?> + params->get('show_item_description') && $text !== '') : ?>
    params->get('show_feed_image', 0) == 0) : ?> diff --git a/libraries/src/Feed/Parser/RssParser.php b/libraries/src/Feed/Parser/RssParser.php index 233efcd892d88..129ea35ca1363 100644 --- a/libraries/src/Feed/Parser/RssParser.php +++ b/libraries/src/Feed/Parser/RssParser.php @@ -372,6 +372,7 @@ protected function processFeedEntry(FeedEntry $entry, \SimpleXMLElement $el) $entry->updatedDate = (string) $el->pubDate; $entry->content = (string) $el->description; $entry->guid = (string) $el->guid; + $entry->isPermaLink = $entry->guid === '' || (string) $el->guid['isPermaLink'] === 'false' ? false : true; $entry->comments = (string) $el->comments; // Add the feed entry author if available. diff --git a/modules/mod_feed/tmpl/default.php b/modules/mod_feed/tmpl/default.php index 997a5e0c786ac..7a645b3706c08 100644 --- a/modules/mod_feed/tmpl/default.php +++ b/modules/mod_feed/tmpl/default.php @@ -58,7 +58,7 @@ $iUrl = isset($feed->image) ? $feed->image : null; $iTitle = isset($feed->imagetitle) ? $feed->imagetitle : null; ?> -
    +
    title !== null && $params->get('rsstitle', 1)) @@ -90,26 +90,24 @@
      get('rssitems', 5)); $i < $max; $i++) { ?> uri) || $feed[$i]->uri !== null) ? trim($feed[$i]->uri) : trim($feed[$i]->guid); - $uri = strpos($uri, 'http') !== 0 ? $params->get('rsslink') : $uri; - $text = !empty($feed[$i]->content) || $feed[$i]->content !== null ? trim($feed[$i]->content) : trim($feed[$i]->description); - $title = trim($feed[$i]->title); + $uri = $feed[$i]->uri || !$feed[$i]->isPermaLink ? trim($feed[$i]->uri) : trim($feed[$i]->guid); + $uri = !$uri || stripos($uri, 'http') !== 0 ? $params->get('rsslink') : $uri; + $text = $feed[$i]->content !== '' ? trim($feed[$i]->content) : ''; ?>
    • - title; ?> + title); ?> - + title); ?> - get('rssitemdesc')) : ?> + get('rssitemdesc') && $text !== '') : ?>
      get('word_count')); echo str_replace(''', "'", $text); ?>