aboutsummaryrefslogtreecommitdiff
path: root/mod/search/views/rss/search/entity.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/search/views/rss/search/entity.php')
-rw-r--r--mod/search/views/rss/search/entity.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/mod/search/views/rss/search/entity.php b/mod/search/views/rss/search/entity.php
new file mode 100644
index 000000000..10d28e8e1
--- /dev/null
+++ b/mod/search/views/rss/search/entity.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Search entity view for RSS feeds.
+ *
+ * @uses $vars['entity']
+ */
+
+if (!array_key_exists('entity', $vars) || !($vars['entity'] instanceof ElggEntity)) {
+ return FALSE;
+}
+
+// title cannot contain HTML but descriptions can.
+$title = strip_tags($vars['entity']->getVolatileData('search_matched_title'));
+$description = $vars['entity']->getVolatileData('search_matched_description');
+
+?>
+
+<item>
+ <guid isPermaLink='true'><?php echo htmlspecialchars($vars['entity']->getURL()); ?></guid>
+ <pubDate><?php echo date("r", $vars['entity']->time_created) ?></pubDate>
+ <link><?php echo htmlspecialchars($vars['entity']->getURL()); ?></link>
+ <title><![CDATA[<?php echo $title; ?>]]></title>
+ <description><![CDATA[<?php echo $description; ?>]]></description>
+</item>