Commit ae8cfe31 authored by Dries's avatar Dries

- Patch #13941 by Prometheus6: Atom parser improvements.

parent 274c44c6
...@@ -289,9 +289,12 @@ function aggregator_element_start($parser, $name, $attributes) { ...@@ -289,9 +289,12 @@ function aggregator_element_start($parser, $name, $attributes) {
case 'SUBTITLE': case 'SUBTITLE':
case 'LOGO': case 'LOGO':
case 'INFO': case 'INFO':
case 'ID':
$element = $name; $element = $name;
break; break;
case 'ID':
if ($element != 'ITEM') {
$element = $name;
}
case 'LINK': case 'LINK':
if ($attributes['REL'] == 'alternate') { if ($attributes['REL'] == 'alternate') {
if ($element == 'ITEM') { if ($element == 'ITEM') {
...@@ -328,10 +331,14 @@ function aggregator_element_end($parser, $name) { ...@@ -328,10 +331,14 @@ function aggregator_element_end($parser, $name) {
case 'ENTRY': case 'ENTRY':
case 'CONTENT': case 'CONTENT':
case 'INFO': case 'INFO':
$element = '';
break;
case 'ID': case 'ID':
if ($element == 'ID') {
$element = ''; $element = '';
} }
} }
}
/** /**
* Call-back function used by the XML parser. * Call-back function used by the XML parser.
......
...@@ -289,9 +289,12 @@ function aggregator_element_start($parser, $name, $attributes) { ...@@ -289,9 +289,12 @@ function aggregator_element_start($parser, $name, $attributes) {
case 'SUBTITLE': case 'SUBTITLE':
case 'LOGO': case 'LOGO':
case 'INFO': case 'INFO':
case 'ID':
$element = $name; $element = $name;
break; break;
case 'ID':
if ($element != 'ITEM') {
$element = $name;
}
case 'LINK': case 'LINK':
if ($attributes['REL'] == 'alternate') { if ($attributes['REL'] == 'alternate') {
if ($element == 'ITEM') { if ($element == 'ITEM') {
...@@ -328,10 +331,14 @@ function aggregator_element_end($parser, $name) { ...@@ -328,10 +331,14 @@ function aggregator_element_end($parser, $name) {
case 'ENTRY': case 'ENTRY':
case 'CONTENT': case 'CONTENT':
case 'INFO': case 'INFO':
$element = '';
break;
case 'ID': case 'ID':
if ($element == 'ID') {
$element = ''; $element = '';
} }
} }
}
/** /**
* Call-back function used by the XML parser. * Call-back function used by the XML parser.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment