return $self;
}
+# Note: If you add a new method, remember that you must check the error
+# state of the bug before returning any data. If $self->{error} is
+# defined, then return something empty. Otherwise you risk potential
+# security holes.
+
sub dup_id {
my ($self) = @_;
-
return $self->{'dup_id'} if exists $self->{'dup_id'};
$self->{'dup_id'} = undef;
+ return if $self->{'error'};
+
if ($self->{'resolution'} eq 'DUPLICATE') {
my $dbh = Bugzilla->dbh;
$self->{'dup_id'} =
return $self->{'actual_time'} if exists $self->{'actual_time'};
- return undef unless (Bugzilla->user &&
+ return undef unless (!$self->{'error'} && Bugzilla->user &&
Bugzilla->user->in_group(Param("timetrackinggroup")));
my $sth = Bugzilla->dbh->prepare("SELECT SUM(work_time)
sub longdescs {
my ($self) = @_;
-
return $self->{'longdescs'} if exists $self->{'longdescs'};
-
+ return [] if $self->{'error'};
$self->{'longdescs'} = &::GetComments($self->{bug_id});
-
return $self->{'longdescs'};
}
sub use_votes {
my ($self) = @_;
+ return 0 if $self->{'error'};
return Param('usevotes')
&& $::prodmaxvotes{$self->{product}} > 0;
sub groups {
my $self = shift;
-
return $self->{'groups'} if exists $self->{'groups'};
+ return [] if $self->{'error'};
my @groups;
sub user {
my $self = shift;
return $self->{'user'} if exists $self->{'user'};
+ return {} if $self->{'error'};
$self->{'user'} = {};
sub choices {
my $self = shift;
return $self->{'choices'} if exists $self->{'choices'};
+ return {} if $self->{'error'};
&::GetVersionTable();