diff options
author | jocuri%softhome.net <> | 2004-03-17 05:18:40 +0000 |
---|---|---|
committer | jocuri%softhome.net <> | 2004-03-17 05:18:40 +0000 |
commit | 17559921835f036a50330476176ea29c598ba84c (patch) | |
tree | 30a62af6791bd961aa5c6be328b9f07fd10a1ce4 /Bugzilla | |
parent | 2e96788b00b440821b98d37d582392a51d79f1a3 (diff) | |
download | bugs-17559921835f036a50330476176ea29c598ba84c.tar bugs-17559921835f036a50330476176ea29c598ba84c.tar.gz bugs-17559921835f036a50330476176ea29c598ba84c.tar.bz2 bugs-17559921835f036a50330476176ea29c598ba84c.tar.xz bugs-17559921835f036a50330476176ea29c598ba84c.zip |
Patch for bug 235459: add icalendar output format in buglist; patch by William Jon McCann <mccannwj@pha.jhu.edu>; r=vlad; a=justdave.
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/Constants.pm | 1 | ||||
-rw-r--r-- | Bugzilla/Template.pm | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm index a1bf74ba0..a61cb4620 100644 --- a/Bugzilla/Constants.pm +++ b/Bugzilla/Constants.pm @@ -103,6 +103,7 @@ use constant contenttypes => "js" => "application/x-javascript" , "csv" => "text/plain" , "png" => "image/png" , + "ics" => "text/calendar" , }; 1; diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index c123154bb..310a18161 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -293,6 +293,31 @@ sub create { return $var; }, + # iCalendar contentline filter + ics => [ sub { + my ($context, @args) = @_; + return sub { + my ($var) = shift; + my ($par) = shift @args; + my ($output) = ""; + + $var =~ s/[\r\n]/ /g; + $var =~ s/([;\\\"])/\\$1/g; + + if ($par) { + $output = sprintf("%s:%s", $par, $var); + } else { + $output = $var; + } + + $output =~ s/(.{75,75})/$1\n /g; + + return $output; + }; + }, + 1 + ], + # 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. |