From 1c32a8053abf18dbb399530c2ceef5dd15aadc71 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Mon, 12 Mar 2007 18:59:05 -0700 Subject: [PATCH] * Include previous title in retitiling action * Use html_escape instead of escape_entities * Add the time in comments to the actio html --- scripts/process.in | 14 +++++++------- scripts/service.in | 16 ++++++++++------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/scripts/process.in b/scripts/process.in index efdfe470..fed541fd 100755 --- a/scripts/process.in +++ b/scripts/process.in @@ -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), "$gBug#$ref". - (length($data->{package})? "; Package ".encode_entities($data->{package})."" : ''). + (length($data->{package})? "; Package ".html_escape($data->{package})."" : ''). "."); &sendmessage(<$gBug#$ref". - (length($data->{package}) ? "; Package ".encode_entities($data->{package})."" : ''). + (length($data->{package}) ? "; Package ".html_escape($data->{package})."" : ''). "."); } else { &htmllog($newref ? "Report" : "Information", "stored", "", "$gBug#$ref". - (length($data->{package}) ? "; Package ".encode_entities($data->{package})."" : ''). + (length($data->{package}) ? "; Package ".html_escape($data->{package})."" : ''). "."); } &sendmessage(<\n".encode_entities($brokenness)."\n

\n" : ''; +$htmlbreak= length($brokenness) ? "

\n".html_escape($brokenness)."\n

\n" : ''; $htmlbreak =~ s/\n\n/\n

\n\n/g; if (length($resentccval)) { - $htmlbreak = " Copy sent to ".encode_entities($resentccval).".". + $htmlbreak = " Copy sent to ".html_escape($resentccval).".". $htmlbreak; } unless (exists $header{'x-debbugs-no-ack'}) { @@ -1090,7 +1090,7 @@ sub htmllog { print(AP "\6\n". "$whatobj $whatverb". - ($where eq '' ? "" : " to ".encode_entities($where).""). + ($where eq '' ? "" : " to ".html_escape($where).""). ":
\n". $desc. "\n\3\n") || &quit("writing db-h/$hash/$ref.log (lh): $!"); close(AP) || &quit("closing db-h/$hash/$ref.log (lh): $!"); diff --git a/scripts/service.in b/scripts/service.in index 80d8cb1d..090a43c2 100755 --- a/scripts/service.in +++ b/scripts/service.in @@ -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". "Request received from ". - encode_entities($header{'from'})."\n". - "to ".encode_entities($controlrequestaddr)."\n". + html_escape($header{'from'})."\n". + "to ".html_escape($controlrequestaddr)."\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". - "".encode_entities($action)."\n". - "Request was from ".encode_entities($header{'from'})."\n". - "to ".encode_entities($controlrequestaddr).". \n". + "\n". + "".html_escape($action)."\n". + "Request was from ".html_escape($header{'from'})."\n". + "to ".html_escape($controlrequestaddr).". \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: $!"); -- 2.39.5