From 9f9e989704b5274afba6a1de0b7bdcc6e7296314 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Mon, 27 Mar 2017 21:05:10 -0400 Subject: Bug 1350909 - Make index.cgi cache-friendly for logged out requests --- Bugzilla/Template.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Bugzilla/Template.pm') 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, -- cgit v1.2.3-24-g4f1b