]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Include previous title in retitiling action
authorDon Armstrong <don@volo>
Tue, 13 Mar 2007 01:59:05 +0000 (18:59 -0700)
committerDon Armstrong <don@volo>
Tue, 13 Mar 2007 01:59:05 +0000 (18:59 -0700)
 * Use html_escape instead of escape_entities
 * Add the time in comments to the actio html

scripts/process.in
scripts/service.in

index efdfe470e7a41651ef65bf4e1ff64ed8de55794a..fed541fda95acd2f1a56dea3c551c1e24718aa63 100755 (executable)
@@ -12,7 +12,7 @@ use Debbugs::Mail qw(send_mail_message encode_headers);
 use Debbugs::Packages qw(getpkgsrc);
 use Debbugs::User qw(read_usertags write_usertags);
 
-use HTML::Entities qw(encode_entities);
+use Debbugs::CGI qw(html_escape);
 
 # TODO DLA; needs config reworking and errorlib reworking
 # use warnings;
@@ -775,7 +775,7 @@ END
     &htmllog($newref ? "Report" : "Information", "forwarded",
              join(', ',"$gSubmitList\@$gListDomain",@resentccs),
              "<code>$gBug#$ref</code>".
-             (length($data->{package})? "; Package <code>".encode_entities($data->{package})."</code>" : '').
+             (length($data->{package})? "; Package <code>".html_escape($data->{package})."</code>" : '').
              ".");
     &sendmessage(<<END,["$gSubmitList\@$gListDomain",@resentccs],[@bccs]);
 Subject: $gBug#$ref: $newsubject
@@ -798,13 +798,13 @@ END
         &htmllog($newref ? "Report" : "Information", "forwarded",
                  $resentccval,
                  "<code>$gBug#$ref</code>".
-                 (length($data->{package}) ? "; Package <code>".encode_entities($data->{package})."</code>" : '').
+                 (length($data->{package}) ? "; Package <code>".html_escape($data->{package})."</code>" : '').
                  ".");
     } else {
         &htmllog($newref ? "Report" : "Information", "stored",
                  "",
                  "<code>$gBug#$ref</code>".
-                 (length($data->{package}) ? "; Package <code>".encode_entities($data->{package})."</code>" : '').
+                 (length($data->{package}) ? "; Package <code>".html_escape($data->{package})."</code>" : '').
                  ".");
     }
     &sendmessage(<<END,[@resentccs],[@bccs]);
@@ -822,10 +822,10 @@ ${source_pr_header}$fwd
 END
 }
 
-$htmlbreak= length($brokenness) ? "<p>\n".encode_entities($brokenness)."\n<p>\n" : '';
+$htmlbreak= length($brokenness) ? "<p>\n".html_escape($brokenness)."\n<p>\n" : '';
 $htmlbreak =~ s/\n\n/\n<P>\n\n/g;
 if (length($resentccval)) {
-    $htmlbreak = "  Copy sent to <code>".encode_entities($resentccval)."</code>.".
+    $htmlbreak = "  Copy sent to <code>".html_escape($resentccval)."</code>.".
         $htmlbreak;
 }
 unless (exists $header{'x-debbugs-no-ack'}) {
@@ -1090,7 +1090,7 @@ sub htmllog {
     print(AP
           "\6\n".
           "<strong>$whatobj $whatverb</strong>".
-          ($where eq '' ? "" : " to <code>".encode_entities($where)."</code>").
+          ($where eq '' ? "" : " to <code>".html_escape($where)."</code>").
           ":<br>\n". $desc.
           "\n\3\n") || &quit("writing db-h/$hash/$ref.log (lh): $!");
     close(AP) || &quit("closing db-h/$hash/$ref.log (lh): $!");
index 80d8cb1d839f970ea0e04b99533dee1bf7b6485d..090a43c270dc04f284e83a2983993b1b5d99b5e7 100755 (executable)
@@ -12,6 +12,7 @@ use Debbugs::User;
 use HTML::Entities qw(encode_entities);
 
 use Debbugs::Config qw(:globals);
+use Debbugs::CGI qw(html_escape);
 $lib_path = $gLibPath;
 require "$lib_path/errorlib";
 $ENV{'PATH'} = $lib_path.':'.$ENV{'PATH'};
@@ -847,8 +848,10 @@ END
             if (&checkpkglimit) {
                 &foundbug;
                 &addmaintainers($data);
+               my $oldtitle = $data->{subject};
                 $data->{subject}= $newtitle;
-                $action= "Changed $gBug title.";
+                $action= "Changed $gBug title to ".html_escape($newtitle)." from ".
+                    html_escape($oldtitle).".";
                 &savebug;
                 &transcript("$action\n");
                 if (length($data->{done})) {
@@ -1196,8 +1199,8 @@ print(AP
       "\2\n$repliedshow\n\5\n$reply\n\3\n".
       "\6\n".
       "<strong>Request received</strong> from <code>".
-      encode_entities($header{'from'})."</code>\n".
-      "to <code>".encode_entities($controlrequestaddr)."</code>\n".
+      html_escape($header{'from'})."</code>\n".
+      "to <code>".html_escape($controlrequestaddr)."</code>\n".
       "\3\n".
       "\7\n",@{escapelog(@log)},"\n\3\n") || &quit("writing db-h/-1.log: $!");
 close(AP) || &quit("open db-h/-1.log: $!");
@@ -1429,9 +1432,10 @@ sub savebug {
     open(L,">>db-h/$hash/$ref.log") || &quit("opening db-h/$hash/$ref.log: $!");
     print(L
           "\6\n".
-          "<strong>".encode_entities($action)."</strong>\n".
-          "Request was from <code>".encode_entities($header{'from'})."</code>\n".
-          "to <code>".encode_entities($controlrequestaddr)."</code>. \n".
+         "<!-- time:".time." -->\n".
+          "<strong>".html_escape($action)."</strong>\n".
+          "Request was from <code>".html_escape($header{'from'})."</code>\n".
+          "to <code>".html_escape($controlrequestaddr)."</code>. \n".
           "\3\n".
           "\7\n",@{escapelog(@log)},"\n\3\n") || &quit("writing db-h/$hash/$ref.log: $!");
     close(L) || &quit("closing db-h/$hash/$ref.log: $!");