Skip to content

Commit

Permalink
Enhance regex
Browse files Browse the repository at this point in the history
Co-authored-by: Guillaume Bougard <[email protected]>
  • Loading branch information
OscarBeiro and g-bougard authored Sep 5, 2023
1 parent 2e34eba commit 464d857
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/GLPI/Agent/Task/Inventory/Linux/AntiVirus/Bitdefender.pm
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ sub _getBitdefenderInfo {
};

foreach my $line (@output) {
my ($key, $value) = $line =~ /^([^:]+):\s+(.+)$/
my ($key, $value) = $line =~ /^(?:\s+-\s)?([^:]+):\s+(.+)$/
or next;
if ($key eq "Product version") {
$av->{VERSION} = $value;
} elsif ($key eq "Engines version") {
$av->{BASE_VERSION} = $value;
} elsif ($key eq " - Antimalware status") {
} elsif ($key eq "Antimalware status") {
$av->{ENABLED} = $value eq "On" ? 1 : 0;
} elsif ($key =~ /New (product update|security content) available/) {
# Set "uptodate" to 0 if one of "new product update available" or "new security content available" is not "no"
Expand Down

0 comments on commit 464d857

Please sign in to comment.