$lastupdated = 0;
$buglist = array();
$bugs_fetch = $db->query("
- SELECT * FROM " . TABLE_PREFIX . "bug
- WHERE product IN (" . fetch_on_bits('canviewbugs', fetch_guest_user()) . ")
- AND (!hidden OR (hidden AND product IN (" . fetch_on_bits('canviewhidden', fetch_guest_user()) . ")))
- ORDER BY " . (can_perform('canviewhidden', 0, fetch_guest_user()) ? "lastposttime" : "hiddenlastposttime") . " DESC
+ SELECT bug.*, comment.comment_parsed
+ FROM " . TABLE_PREFIX . "bug
+ LEFT JOIN " . TABLE_PREFIX . "comment
+ ON (bug.initialreport = comment.commentid)
+ WHERE bug.product IN (" . fetch_on_bits('canviewbugs', fetch_guest_user()) . ")
+ AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden', fetch_guest_user()) . ")))
+ ORDER BY " . (can_perform('canviewhidden', 0, fetch_guest_user()) ? "bug.lastposttime" : "bug.hiddenlastposttime") . " DESC
LIMIT " . $bugsys->options['syndicateditems']
);
while ($bug = $db->fetch_array($bugs_fetch))
{
- $bug['storytext'] = sprintf($lang->string('<div><strong>Bug ID:</strong> %1$s</div>
-<div><strong>Summary:</strong> %2$s</div>
-<div><strong>Product/Component/Version:</strong> %3$s</div>
-<div><strong>Status:</strong> %4$s</div>
-<div><strong>Severity:</strong> %5$s</div>'),
+ $bug['storytext'] = sprintf(str_replace(array('<', '>'), array('<', '>'),
+ $lang->string('<table cellspacing="0" cellpadding="3" border="0">
+<tr>
+ <td><strong>Bug ID:</strong></td>
+ <td>%1$s<//td>
+</tr>
+<tr>
+ <td><strong>Summary:</strong></td>
+ <td>%2$s</td>
+</tr>
+<tr>
+ <td><strong>Product/Component/Version:</strong></td>
+ <td>%3$s</td>
+</tr>
+<tr>
+ <td><strong>Status:</strong></td>
+ <td>%4$s</td>
+</tr>
+<tr>
+ <td><strong>Severity:</strong></td>
+ <td>%5$s</td>
+</table>
+
+<p>%6$s</p>')),
$bug['bugid'],
$bug['summary'],
$bugsys->datastore['product']["$bug[product]"]['title'] . '/' . (($bug['component']) ? $bugsys->datastore['product']["$bug[component]"]['title'] . '/' : '') . $bugsys->datastore['version']["$bug[version]"]['version'],
$bugsys->datastore['status']["$bug[status]"]['status'],
- $bugsys->datastore['severity']["$bug[severity]"]['severity']
+ $bugsys->datastore['severity']["$bug[severity]"]['severity'],
+ $bug['comment_parsed']
);
$buglist["$bug[bugid]"] = $bug;
$lastupdated = $bug["$timestamp"];
if (SYND_TYPE == 'atom')
{
- $feed = '<?xml version="1.0" encoding="utf-8"?>
+ header('Content-type: application/xml');
+
+ echo '<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>' . sprintf($lang->string('%1$s Syndication Feed'), $bugsys->options['trackertitle']) . '</title>
foreach ($buglist AS $bug)
{
- $feed .= '
+ echo '
<entry>
<id>' . $bugsys->options['trackertitle'] . '/showreport.php?bugid=' . $bug['bugid'] . '</id>
<title>' . $bug['summary'] . '</title>
<name>' . $bug['username'] . '</name>
</author>
<content>' . $bug['storytext'] . '</content>
- <summary>
- <!-- firstreport goes here -->
- </summary>
+ <summary>' . htmlspecialchars($bug['comment_parsed']) . '</summary>
<link rel="alternate" href="' . $bugsys->options['trackerurl'] . '/showreport.php?bugid=' . $bug['bugid'] . '"/>
</entry>';
}
- $feed .= '
+ echo '
<!-- / entries -->
</feed>';
-
- header('Content-type: application/xml');
- echo $feed;
-
+
exit;
}