From 17559921835f036a50330476176ea29c598ba84c Mon Sep 17 00:00:00 2001 From: "jocuri%softhome.net" <> Date: Wed, 17 Mar 2004 05:18:40 +0000 Subject: Patch for bug 235459: add icalendar output format in buglist; patch by William Jon McCann ; r=vlad; a=justdave. --- Bugzilla/Template.pm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Bugzilla/Template.pm') 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. -- cgit v1.2.3-24-g4f1b