diff --git a/Koha/REST/Plugin/Query.pm b/Koha/REST/Plugin/Query.pm index 6f981bca1c..d9c3bc97f7 100644 --- a/Koha/REST/Plugin/Query.pm +++ b/Koha/REST/Plugin/Query.pm @@ -194,6 +194,8 @@ is raised. my $match = $reserved_params->{_match} // 'contains'; foreach my $param ( keys %{$filtered_params} ) { + if( $filtered_params->{$param} ) + { if ( $match eq 'exact' || $filtered_params->{$param} =~ m[^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}] ) { $params->{$param} = $filtered_params->{$param}; } elsif ( $match eq 'contains' ) { @@ -209,6 +211,7 @@ is raised. # prevent invalid params to be passed Koha::Exceptions::WrongParameter->throw("Invalid value for _match param ($match)"); } + } } return $params;