summaryrefslogtreecommitdiffstats
path: root/attachment.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-06-21 09:44:46 +0200
committerlpsolit%gmail.com <>2006-06-21 09:44:46 +0200
commitc41117346f48774e5c6731303702b5ce98db517b (patch)
tree96cd49de1876e195d8df5760a5519563db41ae24 /attachment.cgi
parente6f88531bd8d4b4d1e36ed078272dac521fcc6e9 (diff)
downloadbugzilla-c41117346f48774e5c6731303702b5ce98db517b.tar.gz
bugzilla-c41117346f48774e5c6731303702b5ce98db517b.tar.xz
Bug 282121: Remove globals.pl from scripts that no longer use it - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-xattachment.cgi18
1 files changed, 8 insertions, 10 deletions
diff --git a/attachment.cgi b/attachment.cgi
index c79ebf2cb..7acc6e326 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -37,12 +37,10 @@ use strict;
use lib qw(.);
-# Include the Bugzilla CGI and general utility library.
-require "globals.pl";
-
use Bugzilla;
-use Bugzilla::Config qw(:locations);
+use Bugzilla::Config qw(:DEFAULT :localconfig);
use Bugzilla::Constants;
+use Bugzilla::Error;
use Bugzilla::Flag;
use Bugzilla::FlagType;
use Bugzilla::User;
@@ -371,7 +369,7 @@ sub view
{
my $hash = ($attach_id % 100) + 100;
$hash =~ s/.*(\d\d)$/group.$1/;
- if (open(AH, "$attachdir/$hash/attachment.$attach_id")) {
+ if (open(AH, bz_locations()->{'attachdir'} . "/$hash/attachment.$attach_id")) {
binmode AH;
$filesize = (stat(AH))[7];
}
@@ -424,8 +422,8 @@ sub interdiff
#
# Must hack path so that interdiff will work.
#
- $ENV{'PATH'} = $::diffpath;
- open my $interdiff_fh, "$::interdiffbin $old_filename $new_filename|";
+ $ENV{'PATH'} = $diffpath;
+ open my $interdiff_fh, "$interdiffbin $old_filename $new_filename|";
binmode $interdiff_fh;
my ($reader, $last_reader) = setup_patch_readers("", $context);
if ($format eq 'raw')
@@ -558,7 +556,7 @@ sub setup_patch_readers {
$last_reader = $last_reader->sends_data_to;
}
# Add in cvs context if we have the necessary info to do it
- if ($context ne "patch" && $::cvsbin && Param('cvsroot_get'))
+ if ($context ne "patch" && $cvsbin && Param('cvsroot_get'))
{
require PatchReader::AddCVSContext;
$last_reader->sends_data_to(
@@ -583,7 +581,7 @@ sub setup_template_patch_reader
}
$vars->{collapsed} = $cgi->param('collapsed');
$vars->{context} = $context;
- $vars->{do_context} = $::cvsbin && Param('cvsroot_get') && !$vars->{'newid'};
+ $vars->{do_context} = $cvsbin && Param('cvsroot_get') && !$vars->{'newid'};
# Print everything out
print $cgi->header(-type => 'text/html',
@@ -634,7 +632,7 @@ sub diff
else
{
$vars->{other_patches} = [];
- if ($::interdiffbin && $::diffpath) {
+ if ($interdiffbin && $diffpath) {
# Get list of attachments on this bug.
# Ignore the current patch, but select the one right before it
# chronologically.