strict match AND/OR with word-boundries
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 8 Mar 2010 17:28:02 +0000 (17:28 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 8 Mar 2010 17:28:02 +0000 (17:28 +0000)
This fixes problem with search queries like victORian

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1329 07558da8-63fa-0310-ba24-9fe276d99e06

vhost/webpac2.cgi

index 7f122bb..5e4ac0e 100755 (executable)
@@ -217,7 +217,7 @@ if ( my $search = param('search') ) {
        my @attrs = param('attr');
        my $op = param('attr_operator');
 
        my @attrs = param('attr');
        my $op = param('attr_operator');
 
-       if ( $search =~ m{(=|"|AND|OR)} ) {
+       if ( $search =~ m{(=|"|\bAND\b|\bOR\b)} ) {
                push @search, $search;
        } elsif ( @attrs ) {
 
                push @search, $search;
        } elsif ( @attrs ) {