From ff256971c4d3f44b2dd77d3513ec72f74a56909d Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 12 Oct 2010 12:05:34 +0000 Subject: [PATCH] remove non-word characters from query This helps with queries which include "&", "-" or something similar which return nothing in previous implementation git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1340 07558da8-63fa-0310-ba24-9fe276d99e06 --- vhost/webpac2.cgi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vhost/webpac2.cgi b/vhost/webpac2.cgi index 1a678c9..9cf686f 100755 --- a/vhost/webpac2.cgi +++ b/vhost/webpac2.cgi @@ -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 . '"'; -- 2.20.1