From 9294253675caac425403a378cbfa96471b48dae8 Mon Sep 17 00:00:00 2001 From: Calvo Date: Fri, 24 Feb 2023 15:12:18 +0100 Subject: [PATCH] Fix regex to extract version and oum --- pandora_server/lib/PandoraFMS/PluginTools.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index dbb60fa2c8..d937120d39 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -33,7 +33,7 @@ use base 'Exporter'; our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only -my $pandora_version = "7.0NG.769"; +my $pandora_version = "7.0NG.769+ALT"; my $pandora_build = "230224"; our $VERSION = $pandora_version." ".$pandora_build; @@ -118,12 +118,12 @@ sub check_lib_version { $plugin_version = "0NG.0" if empty($plugin_version); - my ($main,$oum) = split /NG./, $plugin_version; + my ($main,$oum) = $plugin_version =~ m/(\d*\.?\d+)NG\.(\d*\.?\d+)/; $main = 0 if empty($main) || !looks_like_number($main); $oum = 0 if empty($oum) || !looks_like_number($oum); - my ($libmain,$liboum) = split /NG./, $pandora_version; + my ($libmain,$liboum) = $pandora_version =~ m/(\d*\.?\d+)NG\.(\d*\.?\d+)/; if (($liboum < $oum) || ($libmain != $main)) {