From d3ba2d4611394a107b0c84f04ec2389a11832059 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 7 Jul 2009 11:11:24 +0000 Subject: [PATCH] =?utf8?q?Bug=20502682:=20CheckIfVotedConfirmed=20fails=20?= =?utf8?q?to=20confirm=20a=20bug=20if=20you=20don't=20have=20the=20permiss?= =?utf8?q?ions=20to=20set=20status/everconfirmed=20-=20Patch=20by=20Fr?= =?utf8?q?=C3=83=C2=A9d=C3=83=C2=A9ric=20Buclin=20=20r/?= =?utf8?q?a=3Dmkanat?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Bugzilla/Bug.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 3ede4732ce..b3ddd26342 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -3160,11 +3160,17 @@ sub CheckIfVotedConfirmed { } ThrowCodeError('no_open_bug_status') unless $new_status; - $bug->set_status($new_status); + # We cannot call $bug->set_status() here, because a user without + # canconfirm privs should still be able to confirm a bug by + # popular vote. We already know the new status is valid, so it's safe. + $bug->{bug_status} = $new_status; + $bug->{everconfirmed} = 1; + delete $bug->{'status'}; # Contains the status object. } else { # If the bug is in a closed state, only set everconfirmed to 1. - $bug->_set_everconfirmed(1); + # Do not call $bug->_set_everconfirmed(), for the same reason as above. + $bug->{everconfirmed} = 1; } $bug->update(); -- 2.47.2