Only escape if there are regexp characters https://github.com/webmin/usermin/issues/37

This commit is contained in:
Jamie Cameron
2018-04-07 13:45:22 -07:00
parent 903ffeb065
commit 2d3e76de67

View File

@@ -85,7 +85,9 @@ else {
$filter->{'condheader'} =~ /^[a-zA-Z0-9\-]+$/ ||
&error($text{'save_econdheader'});
if (!$in{'condregexp'} &&
$in{'condvalue'} !~ /^[a-zA-Z0-9_ ]+$/) {
$in{'condvalue'} =~ /[\^\$\.\*\+\?\|\(\)\[\]\{\}\\]/) {
# If the user didn't ask for a regexp but there are
# regexp special characters, escape them
$in{'condvalue'} = quotemeta($in{'condvalue'});
}
if ($in{'condmode'} == 0) {