Skip to content

Commit 3a38721

Browse files
committed
singlevuln: polish
For the generated per-release page that lists all vulnerbilties that particular version is vulnerable to: - make it wider - add "severity" column and show them like they are shown in the main listing with single letter, colors and a rounded border - add CVE ID to the flaw name - rename the table headers for the versions to first/last to match the main vulnerability listing page - no longer use the odd/even classes
1 parent af7d1d1 commit 3a38721

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

docs/_singlevuln.templ

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
<html>
33
<head> <title>Vulnerabilities in curl %version</title>
44
#include "css.t"
5+
<style type="text/css">
6+
.contents {
7+
max-width: 60em;
8+
overflow: auto;
9+
}
10+
</style>
511
</head>
612

713
#define CURL_DOCS

docs/vulntable.pl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ sub sev2color {
5858
return "black";
5959
}
6060

61+
sub sevtext {
62+
my ($severity) = @_;
63+
64+
return uc(substr($severity, 0, 1));
65+
}
66+
6167
sub single {
6268
my ($sum, $str, $date, $vernum, $vulns, $nextrel, $prevrel) = @_;
6369

@@ -69,12 +75,15 @@ sub single {
6975
my $vulnplural;
7076

7177
if($vulnnum) {
72-
$vulnhtml = "<table><tr class=\"tabletop\"><th>Flaw</th><th>From version</th><th>To and including</th></tr>";
78+
$vulnhtml = "<table><tr class=\"tabletop\"><th>S</th><th>Flaw</th><th>First</th><th>Last</th></tr>";
7379

7480
for my $i (@v) {
75-
$vulnhtml .= sprintf("<tr class=\"%s\"><td><a href=\"%s\">%s</a></td><td><a href=\"vuln-%s.html\">%s</a></td><td><a href=\"vuln-%s.html\">%s</a></td></tr>\n",
76-
$odd&1?"even":"odd",
77-
$vurl[$i], $vulndesc[$i],
81+
$vulnhtml .= sprintf("<tr>".
82+
"<td style=\"color: %s; border-radius: 8px; border: 2px %s solid;\" title=\"Severity %s\">%s</td>".
83+
84+
"<td><a href=\"%s\">%s: %s</a></td><td><a href=\"vuln-%s.html\">%s</a></td><td><a href=\"vuln-%s.html\">%s</a></td></tr>\n",
85+
sev2color($sev[$i]), sev2color($sev[$i]), $sev[$i], sevtext($sev[$i]),
86+
$vurl[$i], $cve[$i], $vulndesc[$i],
7887
$vstart[$i], $vstart[$i],
7988
$vstop[$i], $vstop[$i]);
8089
$odd++;

0 commit comments

Comments
 (0)