Bug 40933
more valid RSS git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@105 6955db30-a419-402b-8a0d-67ecbb4d7f56custis
parent
3e3ba3e551
commit
8ac35e625a
|
@ -704,6 +704,14 @@ sub create {
|
|||
return sub { wrap_comment($_[0], $cols) }
|
||||
}, 1],
|
||||
|
||||
absolute_uris =>
|
||||
sub {
|
||||
my $b = Bugzilla->params->{urlbase};
|
||||
$b =~ s/\/*$/\//so;
|
||||
$_[0] =~ s/(<a[^<>]*href\s*=\s*[\"\']\s*)(?![a-z]+:\/\/)([^\"\'<>]+[\"\'][^<>]*>)/$1$b$2/giso;
|
||||
$_[0];
|
||||
},
|
||||
|
||||
# We force filtering of every variable in key security-critical
|
||||
# places; we have a none filter for people to use when they
|
||||
# really, really don't want a variable to be changed.
|
||||
|
|
|
@ -23,6 +23,7 @@ my $cgi = Bugzilla->cgi;
|
|||
my $template = Bugzilla->template;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
|
||||
$vars->{selfurl} = $cgi->canonicalise_query();
|
||||
$vars->{escapetags} = $cgi->param('escapetags');
|
||||
$vars->{buginfo} = $cgi->param('buginfo');
|
||||
|
||||
|
@ -71,7 +72,7 @@ my $bugsquery = "
|
|||
|
||||
SELECT
|
||||
b.bug_id, b.short_desc, pr.name AS product, cm.name AS component, b.bug_severity, b.bug_status,
|
||||
0 AS work_time, '' AS thetext, '' AS commentlink,
|
||||
0 AS work_time, '' AS thetext, DATE_FORMAT(a.bug_when,'%Y%m%d%H%i%s') AS commentlink,
|
||||
DATE_FORMAT(a.bug_when,'%Y-%m-%dT%H:%iZ') bug_when,
|
||||
DATE_FORMAT(a.bug_when,'%a, %d %b %Y %H:%i:%s $tz') datetime_rfc822,
|
||||
a.bug_when AS `when`, p.login_name, p.realname,
|
||||
|
@ -92,6 +93,7 @@ my $bugsquery = "
|
|||
|
||||
$vars->{events} = $dbh->selectall_arrayref($bugsquery, {Slice => {}});
|
||||
|
||||
my ($t, $o, $n);
|
||||
foreach (@{$vars->{events}})
|
||||
{
|
||||
if ($_->{fieldname})
|
||||
|
@ -105,9 +107,11 @@ foreach (@{$vars->{events}})
|
|||
$_->{old} = format_time_decimal($_->{old});
|
||||
$_->{new} = format_time_decimal($_->{new});
|
||||
}
|
||||
my $t = "Changed '$_->{fielddesc}'";
|
||||
$t .= " from '$_->{old}'" if length $_->{old};
|
||||
$t .= " to '$_->{new}'" if length $_->{new};
|
||||
$o = 1 && length $_->{old};
|
||||
$n = 1 && length $_->{new};
|
||||
$t = "Changed '$_->{fielddesc}' from '$_->{old}' to '$_->{new}'" if $o && $n;
|
||||
$t = "Added to '$_->{fielddesc}': '$_->{new}'" if !$o && $n;
|
||||
$t = "Removed '$_->{fielddesc}': '$_->{old}'" if $o && !$n;
|
||||
$_->{thetext} = $t;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,6 +111,7 @@ foreach my $include_path (@include_paths) {
|
|||
wrap_comment => sub { return $_ },
|
||||
none => sub { return $_ } ,
|
||||
ics => [ sub { return sub { return $_; } }, 1] ,
|
||||
absolute_uris => sub { return $_; } ,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
|
|
@ -3,18 +3,19 @@
|
|||
[% USE date %]
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<?xml-stylesheet type="text/xsl" href="[% Param('urlbase') %]skins/standard/feed.xsl"?>
|
||||
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>[% title FILTER xml %]</title>
|
||||
<link>[% Param('urlbase') %]buglist.cgi?[%- urlquerypart.replace('ctype=rss[&]?','') FILTER xml %]</link>
|
||||
<atom:link href="[% Param('urlbase') %]rss-comments.cgi?[% selfurl FILTER xml %]" rel="self" type="application/rss+xml" />
|
||||
<description>[% "$terms.Bugzilla:" FILTER xml %][% title FILTER xml %]</description>
|
||||
<language>en</language>
|
||||
<lastBuildDate>[% builddate %]</lastBuildDate>
|
||||
[% FOREACH evt = events %]
|
||||
<item>
|
||||
<title>[% evt.realname FILTER html %] [% IF evt.is_new > 0 %] added [% ELSE %] changed [% END %] bug [% evt.bug_id %]: [% evt.short_desc FILTER xml %]</title>
|
||||
<guid isPermaLink="true">[% Param('urlbase') FILTER xml %]show_bug.cgi?id=[% evt.bug_id FILTER xml %]#[%evt.commentlink%]</guid>
|
||||
<link>[% Param('urlbase') FILTER xml %]show_bug.cgi?id=[% evt.bug_id FILTER xml %]#[%evt.commentlink%]</link>
|
||||
<guid isPermaLink="true">[% Param('urlbase') FILTER xml %]show_bug.cgi?id=[% evt.bug_id FILTER xml %]#[% evt.commentlink %]</guid>
|
||||
<link>[% Param('urlbase') FILTER xml %]show_bug.cgi?id=[% evt.bug_id FILTER xml %]#[% evt.commentlink %]</link>
|
||||
<pubDate>[% evt.datetime_rfc822 %]</pubDate>
|
||||
<description><![CDATA[
|
||||
[% IF escapetags > 0 %]
|
||||
|
@ -26,7 +27,7 @@
|
|||
[% END %]
|
||||
<div class="item-signature"><a href="mailto:[% evt.login_name %]">[% evt.realname FILTER html %]</a></div>
|
||||
<pre>
|
||||
[% evt.thetext FILTER wrap_comment FILTER quoteUrls %]
|
||||
[% evt.thetext FILTER wrap_comment FILTER quoteUrls FILTER absolute_uris %]
|
||||
</pre>
|
||||
[% IF UserInGroup(Param('timetrackinggroup')) && (evt.work_time != 0 ) %]
|
||||
<div class="item-worktime">[% evt.work_time %]</div>
|
||||
|
@ -40,7 +41,7 @@
|
|||
[% END %]
|
||||
<div class="item-signature"><a href="mailto:[% evt.login_name %]">[% evt.realname FILTER html %]</a></div>
|
||||
<pre>
|
||||
[% evt.thetext FILTER wrap_comment FILTER quoteUrls %]
|
||||
[% evt.thetext FILTER wrap_comment FILTER quoteUrls FILTER absolute_uris %]
|
||||
</pre>
|
||||
[% IF UserInGroup(Param('timetrackinggroup')) && (evt.work_time != 0 ) %]
|
||||
<div class="item-worktime">[% evt.work_time %]</div>
|
||||
|
|
Loading…
Reference in New Issue