summaryrefslogtreecommitdiffstatshomepage
path: root/modules/aggregator/aggregator.parser.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-07-24 17:42:22 +0000
committerDries Buytaert <dries@buytaert.net>2010-07-24 17:42:22 +0000
commita6f7939484cb29e67731deaa776133060b5eda5d (patch)
treeb131858ce63a97a01dac0f1801105d5b0cd58ce5 /modules/aggregator/aggregator.parser.inc
parentdca92900fbf0b938ae735883ff9bebfc8342e58c (diff)
downloaddrupal-a6f7939484cb29e67731deaa776133060b5eda5d.tar.gz
drupal-a6f7939484cb29e67731deaa776133060b5eda5d.zip
- Patch #130344 by mustafau, David_Rothstein, csevb10: ATOM feed items link to the current page rather than back to the original source. Added Atom tests to the aggregator module.
Diffstat (limited to 'modules/aggregator/aggregator.parser.inc')
-rw-r--r--modules/aggregator/aggregator.parser.inc15
1 files changed, 9 insertions, 6 deletions
diff --git a/modules/aggregator/aggregator.parser.inc b/modules/aggregator/aggregator.parser.inc
index 5eb84db42f9..4b1ff205327 100644
--- a/modules/aggregator/aggregator.parser.inc
+++ b/modules/aggregator/aggregator.parser.inc
@@ -177,7 +177,6 @@ function aggregator_element_start($parser, $name, $attributes) {
switch ($name) {
case 'image':
case 'textinput':
- case 'content':
case 'summary':
case 'tagline':
case 'subtitle':
@@ -186,16 +185,20 @@ function aggregator_element_start($parser, $name, $attributes) {
$element = $name;
break;
case 'id':
+ case 'content':
if ($element != 'item') {
$element = $name;
}
case 'link':
- if (!empty($attributes['rel']) && $attributes['rel'] == 'alternate') {
+ // According to RFC 4287, link elements in Atom feeds without a 'rel'
+ // attribute should be interpreted as though the relation type is
+ // "alternate".
+ if (!empty($attributes['HREF']) && (empty($attributes['REL']) || $attributes['REL'] == 'alternate')) {
if ($element == 'item') {
- $items[$item]['link'] = $attributes['href'];
+ $items[$item]['link'] = $attributes['HREF'];
}
else {
- $channel['link'] = $attributes['href'];
+ $channel['link'] = $attributes['HREF'];
}
}
break;
@@ -223,12 +226,12 @@ function aggregator_element_end($parser, $name) {
case 'textinput':
case 'item':
case 'entry':
- case 'content':
case 'info':
$element = '';
break;
case 'id':
- if ($element == 'id') {
+ case 'content':
+ if ($element == $name) {
$element = '';
}
}