From 7931c778d75cec00bd0d186da18c08e5dcf9a5c4 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 1 Feb 2005 14:09:31 +0000 Subject: - Patch #16513 by James (slightly modified): export categories and enclosures to RSS feeds (and made RSS feeds extensible). NOTE: this needs to be documented. --- includes/common.inc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 084bc5e1e..8a45ff94a 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -689,7 +689,24 @@ function format_rss_item($title, $link, $description, $args = array()) { $output .= ' '. drupal_specialchars(strip_tags($link)) ."\n"; $output .= ' '. drupal_specialchars($description) ."\n"; foreach ($args as $key => $value) { - $output .= ' <'. $key .'>'. drupal_specialchars(strip_tags($value)) ."\n"; + if (is_array($value)) { + if ($value['key']) { + $output .= ' <'. $value['key']; + if (is_array($value['attributes'])) { + $output .= drupal_attributes($value['attributes']); + } + + if ($value['value']) { + $output .= '>'. $value['value'] .'\n"; + } + else { + $output .= " />\n"; + } + } + } + else { + $output .= ' <'. $key .'>'. drupal_specialchars(strip_tags($value)) ."\n"; + } } $output .= "\n"; -- cgit v1.2.3