diff options
Diffstat (limited to 'config.cgi')
-rwxr-xr-x | config.cgi | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/config.cgi b/config.cgi index 7dc2e3afb..56a9a3f8a 100755 --- a/config.cgi +++ b/config.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -6,12 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -################################################################################ -# Script Initialization -################################################################################ - -# Make it harder for us to do dangerous things in Perl. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -105,7 +102,9 @@ $vars->{'closed_status'} = \@closed_status; my @fields = @{Bugzilla::Field->match({obsolete => 0})}; # Exclude fields the user cannot query. if (!$user->is_timetracker) { - @fields = grep { $_->name !~ /^(estimated_time|remaining_time|work_time|percentage_complete|deadline)$/ } @fields; + foreach my $tt_field (TIMETRACKING_FIELDS) { + @fields = grep { $_->name ne $tt_field } @fields; + } } my %FIELD_PARAMS = ( @@ -145,7 +144,11 @@ sub display_data { utf8::encode($digest_data) if utf8::is_utf8($digest_data); my $digest = md5_base64($digest_data); - $cgi->check_etag($digest); + if ($cgi->check_etag($digest)) { + print $cgi->header(-ETag => $digest, + -status => '304 Not Modified'); + exit; + } print $cgi->header (-ETag => $digest, -type => $format->{'ctype'}); |