From: Dylan William Hardison Date: Wed, 14 Nov 2018 20:53:34 +0000 (-0500) Subject: no bug - only pre-render template before server starts X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3812db0928dcf6926f87c13e4f875a87bdca4cc5;p=thirdparty%2Fbugzilla.git no bug - only pre-render template before server starts --- diff --git a/Bugzilla/Quantum/Plugin/BlockIP.pm b/Bugzilla/Quantum/Plugin/BlockIP.pm index 56deb1935..f97ce276a 100644 --- a/Bugzilla/Quantum/Plugin/BlockIP.pm +++ b/Bugzilla/Quantum/Plugin/BlockIP.pm @@ -16,12 +16,16 @@ sub register { $app->helper(block_ip => \&_block_ip); $app->helper(unblock_ip => \&_unblock_ip); - my $template = Bugzilla::Template->create(); - $template->process('global/ip-blocked.html.tmpl', - {block_timeout => BLOCK_TIMEOUT}, - \$BLOCKED_HTML); - undef $template; - utf8::encode($BLOCKED_HTML); + $app->hook( + before_server_start => sub { + my $template = Bugzilla::Template->create(); + $template->process('global/ip-blocked.html.tmpl', + {block_timeout => BLOCK_TIMEOUT}, + \$BLOCKED_HTML); + undef $template; + utf8::encode($BLOCKED_HTML); + } + ); } sub _block_ip {