From e232c22b3d461b8fa2e4cc762fea0eac443b9aac Mon Sep 17 00:00:00 2001 From: externo6 Date: Wed, 16 Oct 2019 10:10:23 +0100 Subject: [PATCH] Only add % to value if % is not present. --- scripts/ZoneMinder/lib/ZoneMinder/Filter.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm b/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm index 7a78e3b71..e14ae8d14 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm @@ -239,7 +239,7 @@ sub Sql { if ( $term->{op} eq 'LIKE' || $term->{op} eq 'NOT LIKE' ) { - $temp_value = '%'.$temp_value.'%'; + $temp_value = '%'.$temp_value.'%' if $temp_value !~ /%/; } $value = "'$temp_value'"; } elsif ( $term->{attr} eq 'DateTime' or $term->{attr} eq 'StartDateTime' or $term->{attr} eq 'EndDateTime' ) {