summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-04-01 16:52:36 +0200
committerDylan William Hardison <dylan@hardison.net>2018-04-01 16:52:36 +0200
commitab229b9a828b77f8a3b9ce215f0dfed4c84d4ae5 (patch)
tree483da9c8b66f4444bb8a410e3d599c7484ad721e /Bugzilla/Template.pm
parentdaa2d6b1c40354ecce0e48e6c5ee686efe642c4b (diff)
parent2f8b999750cc700faf03c6aee1c53d1fc4df767f (diff)
downloadbugzilla-ab229b9a828b77f8a3b9ce215f0dfed4c84d4ae5.tar.gz
bugzilla-ab229b9a828b77f8a3b9ce215f0dfed4c84d4ae5.tar.xz
Merge branch 'master' into unstable
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r--Bugzilla/Template.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index 2ec813303..3ace60cf8 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -284,7 +284,8 @@ sub get_attachment_link {
$link_text =~ s/ \[details\]$//;
$link_text =~ s/ \[diff\]$//;
- my $linkval = "attachment.cgi?id=$attachid";
+ state $urlbase = Bugzilla->localconfig->{urlbase};
+ my $linkval = "${urlbase}attachment.cgi?id=$attachid";
# If the attachment is a patch and patch_viewer feature is
# enabled, add link to the diff.
@@ -572,7 +573,9 @@ sub create {
ABSOLUTE => 1,
RELATIVE => 1,
- COMPILE_DIR => bz_locations()->{'template_cache'},
+ # Only use an on-disk template cache if we're running as the web
+ # server. This ensures the permissions of the cache remain correct.
+ COMPILE_DIR => is_webserver_group() ? bz_locations()->{'template_cache'} : undef,
# Don't check for a template update until 1 hour has passed since the
# last check.
@@ -1071,6 +1074,8 @@ our %_templates_to_precompile;
sub precompile_templates {
my ($output) = @_;
+ return unless is_webserver_group();
+
# Remove the compiled templates.
my $cache_dir = bz_locations()->{'template_cache'};
my $datadir = bz_locations()->{'datadir'};