Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291491

Content:encoded and summary tags should only overwrite description tag if it's not present.

$
0
0

There is currently no check to determine if the description tag is empty, therefore it gets overwritten by content:encoded, summary, and content respectively (if they are present).

The comment: // Atom feeds have a content and/or summary tag instead of a description tag. implies mutual exclusion, however I have come across some feeds with both tags (with description containing a summary, but content:encoded containing the whole long article).

I propose a check before overwriting:

aggregator.parser.inc: function aggregator_parse_feed(&$data, $feed)

<?php
126
+ if (empty($item['description'])) {
    if (!empty(
$item['content:encoded'])) {
     
$item['description'] = $item['content:encoded'];
    }
    elseif (!empty(
$item['summary'])) {
     
$item['description'] = $item['summary'];
    }
    elseif (!empty(
$item['content'])) {
     
$item['description'] = $item['content'];
    }
+ }
?>

Viewing all articles
Browse latest Browse all 291491

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>