Bug 91153 - Fix crash in case of an invalid select value

git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@1725 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2013-07-15 15:19:31 +00:00
parent f60869c8e1
commit ed574f251a
1 changed files with 12 additions and 2 deletions

View File

@ -2123,7 +2123,17 @@ sub _check_select_field
if ($field->visibility_field_id || $field->value_field_id)
{
my $t = Bugzilla::Field::Choice->type($field);
my $object = $t->new({ name => $value }) || $value;
my $object = $t->new({ name => $value });
if (!$object)
{
# Save the raw value if it's invalid
$object = $value;
trick_taint($value);
}
else
{
$value = $object->name;
}
my $tmp = $invocant->dependent_validators;
# Remember the call and perform check later
if ($field->type == FIELD_TYPE_MULTI_SELECT)
@ -2134,7 +2144,7 @@ sub _check_select_field
{
$tmp->{$field->name} = $object;
}
return $object->name;
return $value;
}
my $object = Bugzilla::Field::Choice->type($field)->check($value);
return $object->name;