xref: /web-bugs/www/rss/rss.php (revision 9d47b05f)
1<?php
2echo '<?xml version="1.0"?>';
3
4$desc = "{$bug['package_name']} {$bug['bug_type']}\nReported by ";
5if (preg_match('/@php.net$/i', $bug['email'])) {
6    $desc .= substr($bug['email'], 0, strpos($bug['email'], '@')) ."\n";
7} else {
8    $desc .= substr($bug['email'], 0, strpos($bug['email'], '@')) . "@...\n";
9}
10$desc .= date(DATE_RSS, $bug['submitted']) . "\n";
11$desc .= "PHP: {$bug['php_version']}, OS: {$bug['php_os']}\n\n";
12$desc .= $bug['ldesc'];
13$desc = '<pre>' . clean($desc) . '</pre>';
14
15?>
16<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
17    <channel>
18        <title><?php echo "{$bug['package_name']} Bug #{$bug['id']}"; ?></title>
19        <link><?php echo $uri; ?></link>
20        <description><?php echo clean("[{$bug['status']}] {$bug['sdesc']}"); ?></description>
21        <pubDate><?php echo date('r', $bug['submitted']); ?></pubDate>
22        <lastBuildDate><?php echo date('r', ($bug['modified']) ? $bug['modified'] : $bug['submitted']); ?></lastBuildDate>
23        <atom:link href="<?php echo "{$site_method}://{$site_url}{$basedir}/rss/bug.php?id={$bug['id']}&amp;format=rss2"; ?>" rel="self" type="application/rss+xml" />
24        <item>
25            <title><?php echo ($bug['assign']) ? clean($bug['assign']) : clean(substr($bug['email'], 0, strpos($bug['email'], '@'))), "@... [{$bug['ts1']}]"; ?></title>
26            <description><![CDATA[ <?php echo $desc; ?> ]]></description>
27            <pubDate><?php echo date('r', $bug['submitted']); ?></pubDate>
28            <guid><?php echo $uri; ?></guid>
29        </item>
30<?php
31    foreach ($comments as $comment) {
32        if (empty($comment['registered'])) continue;
33        $displayts = date(DATE_RSS, $comment['added']);
34?>
35            <item>
36                <title><?php echo clean($comment['email'] . " [$displayts]"); ?></title>
37                <description><![CDATA[ <?php echo '<pre>', clean($comment['comment']), '</pre>'; ?>]]></description>
38                <pubDate><?php echo date('r', $comment['added']); ?></pubDate>
39                <guid><?php echo $uri, '#', $comment['added']; ?></guid>
40            </item>
41<?php } ?>
42    </channel>
43</rss>
44