(plugin) apps::pvx::restapi - harden default filter regexp (#3722)

This commit is contained in:
qgarnier 2022-06-10 10:08:37 +02:00 committed by GitHub
parent 4b71779b05
commit 6f1a41b247
1 changed files with 2 additions and 2 deletions

View File

@ -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} } ] }