Bug 289729: fix several "uninitialized value" messages - Patch by Fr�d�ric Buclin <LpSolit@gmail.com> r=wurblzap a=justdave

This commit is contained in:
lpsolit%gmail.com 2005-04-12 20:21:45 +00:00
Родитель 1698cf3af6
Коммит 2025124fde
2 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -280,7 +280,10 @@ sub validate {
&& trim($cgi->param("requestee-$id"))) && trim($cgi->param("requestee-$id")))
{ {
my $requestee_email = trim($cgi->param("requestee-$id")); my $requestee_email = trim($cgi->param("requestee-$id"));
if ($requestee_email ne $flag->{'requestee'}->{'email'}) { my $old_requestee =
$flag->{'requestee'} ? $flag->{'requestee'}->login : '';
if ($old_requestee ne $requestee_email) {
# We know the requestee exists because we ran # We know the requestee exists because we ran
# Bugzilla::User::match_field before getting here. # Bugzilla::User::match_field before getting here.
my $requestee = Bugzilla::User->new_from_login($requestee_email); my $requestee = Bugzilla::User->new_from_login($requestee_email);
@ -551,7 +554,7 @@ sub modify {
my $flag = get($id); my $flag = get($id);
my $status = $cgi->param("flag-$id"); my $status = $cgi->param("flag-$id");
my $requestee_email = trim($cgi->param("requestee-$id")); my $requestee_email = trim($cgi->param("requestee-$id") || '');
# Ignore flags the user didn't change. There are two components here: # Ignore flags the user didn't change. There are two components here:

Просмотреть файл

@ -232,7 +232,9 @@ sub SaveEmail {
foreach my $rel (RELATIONSHIPS) { foreach my $rel (RELATIONSHIPS) {
# Positive events: a ticked box means "send me mail." # Positive events: a ticked box means "send me mail."
foreach my $event (POS_EVENTS) { foreach my $event (POS_EVENTS) {
if (1 == $cgi->param("email-$rel-$event")) { if (defined($cgi->param("email-$rel-$event"))
&& $cgi->param("email-$rel-$event") == 1)
{
$dbh->do("INSERT INTO email_setting " . $dbh->do("INSERT INTO email_setting " .
"(user_id, relationship, event) " . "(user_id, relationship, event) " .
"VALUES ($userid, $rel, $event)"); "VALUES ($userid, $rel, $event)");