summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2017-03-28 03:05:10 +0200
committerDylan William Hardison <dylan@hardison.net>2017-04-04 03:43:30 +0200
commit9f9e989704b5274afba6a1de0b7bdcc6e7296314 (patch)
tree01cc75a06bfb6cf60960fa72de90ad1084a6dfdb /Bugzilla
parent30c35b3aefc582e1bb123b309f9c4971c04094ee (diff)
downloadbugzilla-9f9e989704b5274afba6a1de0b7bdcc6e7296314.tar.gz
bugzilla-9f9e989704b5274afba6a1de0b7bdcc6e7296314.tar.xz
Bug 1350909 - Make index.cgi cache-friendly for logged out requests
Diffstat (limited to 'Bugzilla')
-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,