]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 338365: Bugzilla::BugMail calls Param() outside of any function
authormkanat%bugzilla.org <>
Sun, 21 May 2006 01:12:06 +0000 (01:12 +0000)
committermkanat%bugzilla.org <>
Sun, 21 May 2006 01:12:06 +0000 (01:12 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=ghendricks, a=justdave

Bugzilla/BugMail.pm

index 3919c0ec604c9eca8b11c45208aca73730c1301a..49cfce4d0a977d6bc2481d80e78eb2ca67c1f9e9 100644 (file)
@@ -64,13 +64,6 @@ my %rel_names = (REL_ASSIGNEE          , "AssignedTo",
 
 my %nomail;
 
-my $sitespec = '@'.Param('urlbase');
-$sitespec =~ s/:\/\//\./; # Make the protocol look like part of the domain
-$sitespec =~ s/^([^:\/]+):(\d+)/$1/; # Remove a port number, to relocate
-if ($2) {
-    $sitespec = "-$2$sitespec"; # Put the port number back in, before the '@'
-}
-
 # This is run when we load the package
 if (open(NOMAIL, '<', "$datadir/nomail")) {
     while (<NOMAIL>) {
@@ -651,6 +644,13 @@ sub sendMail {
     $substs{"space"} = " ";
     $substs{"changer"} = $values{'changer'};
     $substs{"changername"} = $values{'changername'};
+
+    my $sitespec = '@' . Param('urlbase');
+    $sitespec =~ s/:\/\//\./; # Make the protocol look like part of the domain
+    $sitespec =~ s/^([^:\/]+):(\d+)/$1/; # Remove a port number, to relocate
+    if ($2) {
+        $sitespec = "-$2$sitespec"; # Put the port number back in, before the '@'
+    }
     if ($isnew) {
         $substs{'threadingmarker'} = "Message-ID: <bug-$id-" . 
                                      $user->id . "$sitespec>";