From caf65e39537dea9dc58022f7430263c88b885cc5 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 23 Aug 2005 05:16:50 +0000 Subject: - Patch #13941 by Promotheus6: Atom feeds have a CONTENT and/or SUMMARY tag instead of a DESCRIPTION tag. Currently, if both tags are present the aggregator appends the content of both fields to replace the content of the DESCRIPTION tag. --- modules/aggregator.module | 14 ++++++++++++-- modules/aggregator/aggregator.module | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/aggregator.module b/modules/aggregator.module index 58080a71e..c7e1fb6c7 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -351,10 +351,10 @@ function aggregator_element_data($parser, $data) { } break; case 'CONTENT': - $items[$item]['DESCRIPTION'] .= $data; + $items[$item]['CONTENT'] .= $data; break; case 'SUMMARY': - $items[$item]['DESCRIPTION'] .= $data; + $items[$item]['SUMMARY'] .= $data; break; case 'TAGLINE': case 'SUBTITLE': @@ -559,6 +559,16 @@ function aggregator_parse_feed(&$data, $feed) { $link = $feed['link']; } + /** + * Atom feeds have a CONTENT and/or SUMMARY tag instead of a DESCRIPTION tag + */ + if ($item['CONTENT']) { + $item['DESCRIPTION'] = $item['CONTENT']; + } + else if ($item['SUMMARY']) { + $item['DESCRIPTION'] = $item['SUMMARY']; + } + /* ** Try to resolve and parse the item's publication date. If no ** date is found, we use the current date instead. diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 58080a71e..c7e1fb6c7 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -351,10 +351,10 @@ function aggregator_element_data($parser, $data) { } break; case 'CONTENT': - $items[$item]['DESCRIPTION'] .= $data; + $items[$item]['CONTENT'] .= $data; break; case 'SUMMARY': - $items[$item]['DESCRIPTION'] .= $data; + $items[$item]['SUMMARY'] .= $data; break; case 'TAGLINE': case 'SUBTITLE': @@ -559,6 +559,16 @@ function aggregator_parse_feed(&$data, $feed) { $link = $feed['link']; } + /** + * Atom feeds have a CONTENT and/or SUMMARY tag instead of a DESCRIPTION tag + */ + if ($item['CONTENT']) { + $item['DESCRIPTION'] = $item['CONTENT']; + } + else if ($item['SUMMARY']) { + $item['DESCRIPTION'] = $item['SUMMARY']; + } + /* ** Try to resolve and parse the item's publication date. If no ** date is found, we use the current date instead. -- cgit v1.2.3