vulnerabilities.cgi fix string handling
authorArne Fitzenreiter <arne_f@ipfire.org>
Sat, 25 May 2019 04:54:35 +0000 (06:54 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sat, 25 May 2019 04:54:35 +0000 (06:54 +0200)
remove lf at the end for correct matching
and not strip "Mitigated:" if it was not full working and still
vulnerable.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
html/cgi-bin/vulnerabilities.cgi

index 74d2220..a15accf 100644 (file)
@@ -150,7 +150,7 @@ for my $vuln (sort keys %VULNERABILITIES) {
                                <font color="$colour">
 END
        if ($message) {
-               print "<strong>$status_message</strong>: $message";
+               print "<strong>$status_message</strong> - $message";
        } else {
                print "<strong>$status_message</strong>";
        }
@@ -227,9 +227,11 @@ sub check_status($) {
        my $status = <FILE>;
        close(FILE);
 
+       chomp($status);
+
        # Fix status when something has been mitigated, but not fully, yet
        if ($status =~ /^(Mitigation): (.*vulnerable.*)$/) {
-               return ("Vulnerable", $2);
+               return ("Vulnerable", $status);
        }
 
        if ($status =~ /^(Vulnerable|Mitigation): (.*)$/) {