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
b1a24eeb
Commit
b1a24eeb
authored
Mar 06, 2007
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 372533: Bugzilla::Object->update throws a warning if some values are undefined
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
parent
ae185749
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
Object.pm
Bugzilla/Object.pm
+15
-7
No files found.
Bugzilla/Object.pm
View file @
b1a24eeb
...
...
@@ -173,15 +173,23 @@ sub update {
my
(
@update_columns
,
@values
,
%
changes
);
foreach
my
$column
(
$self
->
UPDATE_COLUMNS
)
{
if
(
$old_self
->
{
$column
}
ne
$self
->
{
$column
})
{
my
$value
=
$self
->
{
$column
};
trick_taint
(
$value
)
if
defined
$value
;
push
(
@values
,
$value
);
my
(
$old
,
$new
)
=
(
$old_self
->
{
$column
},
$self
->
{
$column
});
# This has to be written this way in order to allow us to set a field
# from undef or to undef, and avoid warnings about comparing an undef
# with the "eq" operator.
if
(
!
defined
$new
||
!
defined
$old
)
{
next
if
!
defined
$new
&&
!
defined
$old
;
}
elsif
(
$old
eq
$new
)
{
next
;
}
trick_taint
(
$new
)
if
defined
$new
;
push
(
@values
,
$new
);
push
(
@update_columns
,
$column
);
# We don't use $value
because we don't want to detaint this for
# We don't use $new
because we don't want to detaint this for
# the caller.
$changes
{
$column
}
=
[
$old_self
->
{
$column
},
$self
->
{
$column
}];
}
$changes
{
$column
}
=
[
$old
,
$self
->
{
$column
}];
}
my
$columns
=
join
(
', '
,
map
{
"$_ = ?"
}
@update_columns
);
...
...
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