From f0904eeb31097c19ec30e9a516bf50392f93a987 Mon Sep 17 00:00:00 2001
From: ajt <>
Date: Mon, 2 Oct 2000 03:19:07 -0800
Subject: [PATCH] [project @ 2000-10-02 04:19:07 by ajt] sani (from errorlib)
 -> htmlsanit (common.pl) various other changes to avoid some perl warnings

---
 cgi/bugreport.cgi | 22 +++++++++++-----------
 cgi/common.pl     |  4 ++--
 cgi/pkgreport.cgi | 14 +++++++-------
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi
index 6a699f96..3d06a11d 100755
--- a/cgi/bugreport.cgi
+++ b/cgi/bugreport.cgi
@@ -5,7 +5,7 @@ package debbugs;
 use strict;
 use CGI qw/:standard/;
 
-require '/usr/lib/debbugs/errorlib';
+#require '/usr/lib/debbugs/errorlib';
 #require '/usr/lib/debbugs/common.pl';
 require '/debian/home/ajt/newajbug/common.pl';
 
@@ -59,8 +59,8 @@ $indexentry .= $showseverity;
 $indexentry .= "Package: <A HREF=\"" . pkgurl($status{package}) . "\">"
 	    .htmlsanit($status{package})."</A>;\n";
 
-$indexentry .= ";Reported by: ".&sani($status{originator});
-$indexentry .= ";\nKeywords: ".&sani($status{keywords}) 
+$indexentry .= ";Reported by: ".htmlsanit($status{originator});
+$indexentry .= ";\nKeywords: ".htmlsanit($status{keywords}) 
 			if length($status{keywords});
 
 my @merged= split(/ /,$status{mergedwith});
@@ -79,16 +79,16 @@ chomp($dummy);
 $submitted = ";\ndated ".$dummy;
 
 if (length($status{done})) {
-	$indexentry .= ";\n<strong>Done:</strong> ".&sani($status{done});
+	$indexentry .= ";\n<strong>Done:</strong> ".htmlsanit($status{done});
 } elsif (length($status{forwarded})) {
-	$indexentry .= ";\n<strong>Forwarded</strong> to ".&sani($status{forwarded});
+	$indexentry .= ";\n<strong>Forwarded</strong> to ".htmlsanit($status{forwarded});
 }
 
 my ($short, $tmaint);
 $short = $ref; $short =~ s/^\d+/#$&/;
 $tmaint = defined($maintainer{$tpack}) ? $maintainer{$tpack} : '(unknown)';
 $descriptivehead= $indexentry.$submitted.";\nMaintainer for $status{package} is\n".
-            '<A href="http://'.$debbugs::gWebDomain.'/db/ma/l'.&maintencoded($tmaint).'.html">'.&sani($tmaint).'</A>.';
+            '<A href="http://'.$debbugs::gWebDomain.'/db/ma/l'.&maintencoded($tmaint).'.html">'.htmlsanit($tmaint).'</A>.';
 
 my $buglog = buglog($ref);
 open L, "<$buglog" or &quit("open log for $ref: $!");
@@ -173,22 +173,22 @@ while(my $line = <L>) {
 		$pl =~ s/\n+$//;
 		m/^Received: \(at (\S+)\) by (\S+)\;/
 			|| &quit("bad line \`$pl' in state incoming-recv");
-		$this = "<h2>Message received at ".&sani("$1\@$2")
+		$this = "<h2>Message received at ".htmlsanit("$1\@$2")
 		        . ":</h2><br>\n<pre>\n$_";
 		$normstate= 'go';
 	} elsif ($normstate eq 'html') {
 		$this .= $_;
 	} elsif ($normstate eq 'go') {
-		$this .= &sani($_);
+		$this .= htmlsanit($_);
 	} elsif ($normstate eq 'go-nox') {
 		next if !s/^X//;
-		$this .= &sani($_);
+		$this .= htmlsanit($_);
         } elsif ($normstate eq 'recips') {
 		if (m/^-t$/) {
 			$this = "<h2>Message sent:</h2><br>\n";
 		} else {
 			s/\04/, /g; s/\n$//;
-			$this = "<h2>Message sent to ".&sani($_).":</h2><br>\n";
+			$this = "<h2>Message sent to ".htmlsanit($_).":</h2><br>\n";
 		}
 		$normstate= 'kill-body';
 	} elsif ($normstate eq 'autocheck') {
@@ -215,7 +215,7 @@ print start_html(
 	-title => "$debbugs::gProject $debbugs::gBug report logs - $short");
 
 print h1("$debbugs::gProject $debbugs::gBug report logs -  $short<br>\n"
-	. sani($status{subject}));
+	. htmlsanit($status{subject}));
 
 print "$descriptivehead\n";
 print hr;
diff --git a/cgi/common.pl b/cgi/common.pl
index f3d45e52..fdf8e68f 100644
--- a/cgi/common.pl
+++ b/cgi/common.pl
@@ -213,7 +213,7 @@ sub maintbugs {
     my %maintainers = getmaintainers();
     my $chk = sub {
         my %d = @_;
-        ($maintemail = $maintainers{$d{"pkg"}}) =~ s/\s*\(.*\)\s*//;
+        ($maintemail = $maintainers{$d{"pkg"}} || "") =~ s/\s*\(.*\)\s*//;
         if ($maintemail =~ m/<(.*)>/) { $maintemail = $1 }
         return $maintemail eq $maint;
     };
@@ -223,7 +223,7 @@ sub maintbugs {
 sub maintencbugs {
     my $maint = shift;
     my %maintainers = getmaintainers();
-    return getbugs(sub {my %d=@_; return maintencoded($maintainers{$d{"pkg"}}) eq $maint});
+    return getbugs(sub {my %d=@_; return maintencoded($maintainers{$d{"pkg"}} || "") eq $maint});
 }
 
 sub pkgbugs {
diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi
index 22a9c212..fa78845b 100755
--- a/cgi/pkgreport.cgi
+++ b/cgi/pkgreport.cgi
@@ -7,7 +7,7 @@ use CGI qw/:standard/;
 
 require '/debian/home/ajt/newajbug/common.pl';
 #require '/usr/lib/debbugs/common.pl';
-require '/usr/lib/debbugs/errorlib';
+#require '/usr/lib/debbugs/errorlib';
 
 require '/etc/debbugs/config';
 require '/etc/debbugs/text';
@@ -32,6 +32,7 @@ my %strings = ();
 my $dtime=`date -u '+%H:%M:%S GMT %a %d %h'`;
 chomp($dtime);
 my $tail_html = $debbugs::gHTMLTail;
+$tail_html = $debbugs::gHTMLTail;
 $tail_html =~ s/SUBSTITUTE_DTIME/$dtime/;
 
 my $tag;
@@ -71,13 +72,12 @@ print start_html(
 
 print h1("$debbugs::gProject $Archived $debbugs::gBug report logs: $tag");
 
-if (defined $maintainer{$pkg}) {
-    print "<p>Maintainer for $pkg is <a href=\"" 
-          . mainturl($maintainer{$pkg}) . "\">"
-          . htmlsanit($maintainer{$pkg}) . "</a>.</p>\n";
-}
-
 if (defined $pkg) {
+    if (defined $maintainer{$pkg}) {
+        print "<p>Maintainer for $pkg is <a href=\"" 
+              . mainturl($maintainer{$pkg}) . "\">"
+              . htmlsanit($maintainer{$pkg}) . "</a>.</p>\n";
+    }
     print "<p>Note that with multi-binary packages there may be other\n";
     print "reports filed under the different binary package names.</p>\n";
 } elsif (defined $maint || defined $maintenc) {
-- 
2.39.5