summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r--Bugzilla/Template.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index 2887f0138..1f0892a32 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -38,6 +38,7 @@ use File::Spec;
use IO::Dir;
use List::MoreUtils qw(firstidx);
use Scalar::Util qw(blessed);
+use JSON::XS qw(encode_json);
use base qw(Template);
@@ -976,6 +977,10 @@ sub create {
# Function for retrieving global parameters.
'Param' => sub { return Bugzilla->params->{$_[0]}; },
+ json_encode => sub {
+ return encode_json($_[0]);
+ },
+
# Function to create date strings
'time2str' => \&Date::Format::time2str,