Bug 337747: config.cgi fails with an SQL error in Bugzilla::Keyword with no keywords defined

Patch by Colin Ogilvie <colin.ogilvie@gmail.com>; r=mkanat; a=justdave
parent d72d5a40
...@@ -82,7 +82,7 @@ sub new_from_list { ...@@ -82,7 +82,7 @@ sub new_from_list {
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $keywords; my $keywords;
if ($id_list) { if (@$id_list) {
my @detainted_ids; my @detainted_ids;
foreach my $id (@$id_list) { foreach my $id (@$id_list) {
detaint_natural($id) || detaint_natural($id) ||
...@@ -94,9 +94,7 @@ sub new_from_list { ...@@ -94,9 +94,7 @@ sub new_from_list {
"SELECT $columns FROM keyworddefs WHERE id IN (" "SELECT $columns FROM keyworddefs WHERE id IN ("
. join(',', @detainted_ids) . ")", {Slice=>{}}); . join(',', @detainted_ids) . ")", {Slice=>{}});
} else { } else {
ThrowCodeError('bad_arg', return [];
{argument => 'id_list',
function => 'Bugzilla::Keyword::new_from_list'});
} }
foreach my $keyword (@$keywords) { foreach my $keyword (@$keywords) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment