]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1543798 - Do not treat email addresses with invalid.bugs as unassigned when displ...
authorKohei Yoshino <kohei.yoshino@gmail.com>
Fri, 12 Apr 2019 21:15:11 +0000 (17:15 -0400)
committerGitHub <noreply@github.com>
Fri, 12 Apr 2019 21:15:11 +0000 (17:15 -0400)
extensions/BMO/Extension.pm
extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
extensions/ComponentWatching/Extension.pm
template/en/default/attachment/create.html.tmpl

index e618e83ef43b53800a8f5570a8fc6e81b9ed9c6d..c34a567be23386a12e7d66aee1a8a758d545adb0 100644 (file)
@@ -995,7 +995,7 @@ sub _bug_reporters_hw_os {
 sub _bug_is_unassigned {
   my ($self) = @_;
   my $assignee = $self->assigned_to->login;
-  return $assignee eq 'nobody@mozilla.org' || $assignee =~ /\.bugs$/;
+  return $assignee eq 'nobody@mozilla.org' || $assignee =~ /@(?!invalid).+\.bugs$/;
 }
 
 sub _bug_has_current_patch {
@@ -1176,7 +1176,7 @@ sub object_start_of_update {
   # and the assignee isn't a real person
   return
     unless $new_bug->assigned_to->login eq 'nobody@mozilla.org'
-    || $new_bug->assigned_to->login =~ /\.bugs$/;
+    || $new_bug->assigned_to->login =~ /@(?!invalid).+\.bugs$/;
 
   # and the user can set the status to NEW
   return
index e94c43b6f776e2e784fef63e0aefbf9f1f53ac44..66e8f40ce50be2eecc40b32b4d4dca84655f0c21 100644 (file)
@@ -20,7 +20,7 @@
   # these are used in a few places
   is_cced = bug.cc.contains(user.login);
   unassigned = (bug.assigned_to.login == "nobody@mozilla.org")
-               || (bug.assigned_to.login.search('\.bugs$'));
+               || (bug.assigned_to.login.search('@(?!invalid).+\.bugs$'));
 
   # custom fields that have custom rendering, or should not be rendered
   rendered_custom_fields = [
index c1051111c064dd71e2194689fec37e645cf0be45..4e4a2583e4c5a5a98f17d77cfc16bf70a144fbd4 100644 (file)
@@ -243,7 +243,7 @@ sub _check_watch_user {
   if ($value eq '') {
     ThrowUserError('component_watch_missing_watch_user');
   }
-  if ($value !~ /\.bugs$/i) {
+  if ($value !~ /@(?!invalid).+\.bugs$/i) {
     ThrowUserError('component_watch_invalid_watch_user');
   }
   return Bugzilla::User->check($value)->id;
index bdeda59dfd24a627e658b5df0507b303db65b99e..1fc876d60e808b337e04a3fa2c929a5a9dc2ce98 100644 (file)
@@ -74,7 +74,7 @@
         <td>
           <em>If you want to assign this [% terms.bug %] to yourself,
               check the box below.</em><br>
-          [% IF bug.assigned_to.login == "nobody@mozilla.org" || bug.assigned_to.login.search('.bugs$') %]
+          [% IF bug.assigned_to.login == "nobody@mozilla.org" || bug.assigned_to.login.search('@(?!invalid).+\.bugs$') %]
             [% take_if_patch = 1 %]
           [% END %]
           <input type="checkbox" id="takebug" name="takebug" value="1" [% IF take_if_patch %] data-take-if-patch="1" [% END %]>