summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Flag.pm7
-rwxr-xr-xuserprefs.cgi4
2 files changed, 8 insertions, 3 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm
index 0aca49c87..29215876a 100644
--- a/Bugzilla/Flag.pm
+++ b/Bugzilla/Flag.pm
@@ -280,7 +280,10 @@ sub validate {
&& 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
# Bugzilla::User::match_field before getting here.
my $requestee = Bugzilla::User->new_from_login($requestee_email);
@@ -551,7 +554,7 @@ sub modify {
my $flag = get($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:
diff --git a/userprefs.cgi b/userprefs.cgi
index 92e110f3b..9c2135eb3 100755
--- a/userprefs.cgi
+++ b/userprefs.cgi
@@ -232,7 +232,9 @@ sub SaveEmail {
foreach my $rel (RELATIONSHIPS) {
# Positive events: a ticked box means "send me mail."
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 " .
"(user_id, relationship, event) " .
"VALUES ($userid, $rel, $event)");