diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-04-01 16:52:36 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-04-01 16:52:36 +0200 |
commit | ab229b9a828b77f8a3b9ce215f0dfed4c84d4ae5 (patch) | |
tree | 483da9c8b66f4444bb8a410e3d599c7484ad721e /Bugzilla/Template.pm | |
parent | daa2d6b1c40354ecce0e48e6c5ee686efe642c4b (diff) | |
parent | 2f8b999750cc700faf03c6aee1c53d1fc4df767f (diff) | |
download | bugzilla-ab229b9a828b77f8a3b9ce215f0dfed4c84d4ae5.tar.gz bugzilla-ab229b9a828b77f8a3b9ce215f0dfed4c84d4ae5.tar.xz |
Merge branch 'master' into unstable
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r-- | Bugzilla/Template.pm | 9 |
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'}; |