Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
fa680969
Commit
fa680969
authored
Jul 14, 2004
by
bugreport%peshkin.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 250967: Fix spurious updates to requesteeless flags
patch by jouni r=kiko,joel a=justdave
parent
ebea3d35
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
Flag.pm
Bugzilla/Flag.pm
+23
-14
No files found.
Bugzilla/Flag.pm
View file @
fa680969
...
...
@@ -373,21 +373,30 @@ sub modify {
my
$status
=
$data
->
{
"flag-$id"
};
my
$requestee_email
=
trim
(
$data
->
{
"requestee-$id"
});
# Ignore flags the user didn't change. There are two components here:
# either the status changes (trivial) or the requestee changes.
# Change of either field will cause full update of the flag.
my
$status_changed
=
(
$status
ne
$flag
->
{
'status'
});
# Ignore flags the user didn't change. A flag hasn't changed
# if its status and requestee remain the same. Status is easy;
# we just compare the existing status with the submitted one.
# For requestee, however, we have to be careful not to compare
# the two if the flag isn't specifically requestable or isn't
# being requested, otherwise we'll get false positives and think
# the user changed the flag when they didn't.
next
if
$status
eq
$flag
->
{
'status'
}
# the flag's status hasn't changed, and:
&&
(
!
$flag
->
{
'type'
}
->
{
'is_requesteeble'
}
# the flag isn't specifically requestable
||
$status
ne
"?"
# or the flag isn't being requested
||
(
$flag
->
{
'requestee'
}
# or the requestee hasn't changed
&&
(
$requestee_email
eq
$flag
->
{
'requestee'
}
->
login
)));
# Requestee is considered changed, if all of the following apply:
# 1. Flag status is '?' (requested)
# 2. Flag can have a requestee
# 3. The requestee specified on the form is different from the
# requestee specified in the db.
my
$old_requestee
=
$flag
->
{
'requestee'
}
?
$flag
->
{
'requestee'
}
->
login
:
''
;
my
$requestee_changed
=
(
$status
eq
"?"
&&
$flag
->
{
'type'
}
->
{
'is_requesteeble'
}
&&
$old_requestee
ne
$requestee_email
);
next
unless
(
$status_changed
||
$requestee_changed
);
# Since the status is validated, we know it's safe, but it's still
# tainted, so we have to detaint it before using it in a query.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment