From 3ac6dc267b42878e1622b8bcac1ceb642ca711cc Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 19 Feb 2020 09:42:54 -0500 Subject: [PATCH] out an error if name contains invalid characters --- scripts/zmcamtool.pl.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/zmcamtool.pl.in b/scripts/zmcamtool.pl.in index 7e345b79d..3d68b1408 100644 --- a/scripts/zmcamtool.pl.in +++ b/scripts/zmcamtool.pl.in @@ -352,9 +352,13 @@ sub exportsql { } my $name = $ARGV[0]; - if ($name && $name =~ /^([A-Za-z0-9 ,.&()\/\-]+)$/) { # Allow alphanumeric and " ,.&()/-" - $name = $1; - $command .= qq( --where="Name = '$name'"); + if ( $name ) { + if ( $name =~ /^([A-Za-z0-9 ,.&()\/\-]+)$/ ) { # Allow alphanumeric and " ,.&()/-" + $name = $1; + $command .= qq( --where="Name = '$name'"); + } else { + print "Invalid characters in Name\n"; + } } $command .= " zm Controls MonitorPresets";