remove non-word characters from query
[webpac2] / vhost / webpac2.cgi
index 1a678c9..9cf686f 100755 (executable)
@@ -234,6 +234,9 @@ if ( my $search = param('search') ) {
                                   $template =~ s{Q}{$v};
                                $whitespace = " AND " if $whitespace;
 
+                               # don't return -* &* and other non-word characters
+                               return '' if $template =~ m/^\W\*$/;
+
                                return
                                        $whitespace .
                                        $attr . '="' . $template . '"';