From 6f1a41b247aaa34f859f7b84338add324ed46027 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Fri, 10 Jun 2022 10:08:37 +0200 Subject: [PATCH] (plugin) apps::pvx::restapi - harden default filter regexp (#3722) --- centreon-plugins/apps/pvx/restapi/custom/api.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/apps/pvx/restapi/custom/api.pm b/centreon-plugins/apps/pvx/restapi/custom/api.pm index 4e3a0b3bc..6e348e03b 100644 --- a/centreon-plugins/apps/pvx/restapi/custom/api.pm +++ b/centreon-plugins/apps/pvx/restapi/custom/api.pm @@ -167,8 +167,8 @@ sub query_range { my $result = $self->get_endpoint(url_path => '/query?expr=' . $uri->encode($query)); - if (defined( $self->{option_results}->{default_value} ) && $options{filter} ne '' && !exists( $result->{data} )) { - $options{filter} =~ /([^\s\\]+) = \"([^\s\\]+)\"/; + if (defined($self->{option_results}->{default_value}) && $options{filter} ne '' && !exists($result->{data})) { + $options{filter} =~ /\s*([^\s\\]+)\s*=\s*\"(.*)\"/; $result->{data} = [ { key => [ { value => $2 } ] }, { values => [ { value => $self->{option_results}->{default_value} } ] }