From a0196b5d1ed38b7bf7f0783c1c865d6642f2e2b2 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Thu, 29 Jun 2006 23:49:55 +0000 Subject: Bug 342121: Remove usage of Config qw(:locations) in favor of Constants::bz_locations() Patch By Max Kanat-Alexander r=LpSolit, a=justdave --- Bugzilla/Attachment.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Attachment.pm') diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index a7961d764..78d326049 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -47,9 +47,10 @@ that users upload to the Bugzilla server. =cut +use Bugzilla::Constants; use Bugzilla::Error; use Bugzilla::Flag; -use Bugzilla::Config qw(:locations Param); +use Bugzilla::Config; use Bugzilla::User; use Bugzilla::Util qw(trick_taint); @@ -384,7 +385,7 @@ sub _get_local_filename { my $self = shift; my $hash = ($self->id % 100) + 100; $hash =~ s/.*(\d\d)$/group.$1/; - return "$attachdir/$hash/attachment." . $self->id; + return bz_locations()->{'attachdir'} . "/$hash/attachment." . $self->id; } sub _validate_filename { @@ -700,6 +701,7 @@ sub insert_attachment_for_bug { # If the file is to be stored locally, stream the file from the webserver # to the local file without reading it into a local variable. if ($cgi->param('bigfile')) { + my $attachdir = bz_locations()->{'attachdir'}; my $fh = $cgi->upload('data'); my $hash = ($attachid % 100) + 100; $hash =~ s/.*(\d\d)$/group.$1/; -- cgit v1.2.3-24-g4f1b