diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-02-01 14:09:31 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-02-01 14:09:31 +0000 |
commit | 7931c778d75cec00bd0d186da18c08e5dcf9a5c4 (patch) | |
tree | e6f833984fbe5909016351d7d6190a54031ecfab /includes | |
parent | 171de5d46db2523bfd581a726979209efb608998 (diff) | |
download | brdo-7931c778d75cec00bd0d186da18c08e5dcf9a5c4.tar.gz brdo-7931c778d75cec00bd0d186da18c08e5dcf9a5c4.tar.bz2 |
- Patch #16513 by James (slightly modified): export categories and enclosures to RSS feeds (and made RSS feeds extensible).
NOTE: this needs to be documented.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 19 |
1 files changed, 18 insertions, 1 deletions
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 .= ' <link>'. drupal_specialchars(strip_tags($link)) ."</link>\n"; $output .= ' <description>'. drupal_specialchars($description) ."</description>\n"; foreach ($args as $key => $value) { - $output .= ' <'. $key .'>'. drupal_specialchars(strip_tags($value)) ."</$key>\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'] .'</'. $value['key'] .">\n"; + } + else { + $output .= " />\n"; + } + } + } + else { + $output .= ' <'. $key .'>'. drupal_specialchars(strip_tags($value)) ."</$key>\n"; + } } $output .= "</item>\n"; |