]> git.donarmstrong.com Git - debbugs.git/commitdiff
encode addresses before checking if they are valid
authorDon Armstrong <don@donarmstrong.com>
Sun, 26 Mar 2023 22:52:57 +0000 (15:52 -0700)
committerDon Armstrong <don@donarmstrong.com>
Sun, 26 Mar 2023 22:52:57 +0000 (15:52 -0700)
lib/Debbugs/Control.pm
lib/Debbugs/Control/Service.pm

index 38b83abfdba0806040825bad3d8cc2ec288535cc..4396b057f2ff697369f4abd53912b0df62b6ae61 100644 (file)
@@ -96,7 +96,7 @@ BEGIN{
                     package => [qw(set_package)],
                     block   => [qw(set_blocks)],
                     merge   => [qw(set_merged)],
-                    tag     => [qw(set_tag)],
+                    tag     => [qw(set_tag valid_usertag)],
                     clone   => [qw(clone_bug)],
                     archive => [qw(bug_archive bug_unarchive),
                                ],
@@ -3295,7 +3295,7 @@ sub bug_unarchive {
      __end_control(%info);
 }
 
-= head2 valid_usertag
+=head2 valid_usertag
 
      valid_usertag
 
index 52d7d10dab6f14aa3794c42a8dde0e728140ebef..f3e3bd06937412504c2ecad8ec897dd92ed21aa3 100644 (file)
@@ -93,6 +93,7 @@ use Debbugs::Config qw(:config);
 use Debbugs::Common qw(cleanup_eval_fail);
 use Debbugs::Control qw(:all);
 use Debbugs::Status qw(splitpackages);
+use Debbugs::MIME qw(encode_rfc1522);
 use Params::Validate qw(:types validate_with);
 use List::AllUtils qw(first);
 
@@ -367,7 +368,7 @@ sub control_line {
     }
     elsif ($ctl eq 'submitter') {
        my $newsubmitter = $matches[1] eq '!' ? $param{replyto} : $matches[1];
-        if (not Mail::RFC822::Address::valid($newsubmitter)) {
+        if (not Mail::RFC822::Address::valid(encode_rfc1522($newsubmitter))) {
             print {$transcript} "$newsubmitter is not a valid e-mail address; not changing submitter\n";
             $errors++;
        }