From ed574f251ad9a3b6170334b3a31a6a2dd4733f30 Mon Sep 17 00:00:00 2001 From: vfilippov Date: Mon, 15 Jul 2013 15:19:31 +0000 Subject: [PATCH] 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 --- Bugzilla/Bug.pm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 25750eeb6..2e943faf6 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -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;