]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Cleaned up RSS entity view for search a bit.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 12 Jan 2010 02:52:25 +0000 (02:52 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 12 Jan 2010 02:52:25 +0000 (02:52 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3801 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/search/views/rss/search/entity.php

index 8c3609fe50486dee4d836b5098f7708a838bf167..a8f9ebcc49cbe5b51f6591fa2c0d8920cdc0897e 100644 (file)
@@ -9,24 +9,20 @@
  * @link http://elgg.org/
  */
 
-$title = $vars['entity']->title;
-if (empty($title)) {
-       $title = substr($vars['entity']->description, 0, 32);
-       if (strlen($vars['entity']->description) > 32) {
-               $title .= " ...";
-       }
+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
-       $summary = $vars['entity']->summary;
-       if (!empty($summary)) echo wpautop($summary);
-       echo (autop($vars['entity']->description));
-?>]]></description>
+       <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>