]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
no bug - only pre-render template before server starts
authorDylan William Hardison <dylan@hardison.net>
Wed, 14 Nov 2018 20:53:34 +0000 (15:53 -0500)
committerGitHub <noreply@github.com>
Wed, 14 Nov 2018 20:53:34 +0000 (15:53 -0500)
Bugzilla/Quantum/Plugin/BlockIP.pm

index 56deb193576195d1dce2d7c641624044b79e71ce..f97ce276a4be0c9e90fbadfdbe057f4a5a1440cc 100644 (file)
@@ -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 {