out an error if name contains invalid characters

This commit is contained in:
Isaac Connor 2020-02-19 09:42:54 -05:00
parent 292f0ea077
commit 258ae23fb9
1 changed files with 7 additions and 3 deletions

View File

@ -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";