Zen Cart Logo
Forums / Bug Reports / Search with a ( or ) in the query returns an invalid keywords error message

Search with a ( or ) in the query returns an invalid keywords error message

Views: 1,194

Results 1 to 2 of 2
29 Sep 2011, 8:56 AM
#1
patf avatar

patf

Zen Follower

Join Date:
May 2008
Posts:
200
Plugin Contributions:
0

Search with a ( or ) in the query returns an invalid keywords error message

Version 1.3.9h

Any search term with the characters ( or ) returns an invalid keyword error.

The issue is if any of these brackets have a space between them. For example Call Of Duty ( Wii Pre Owned ) generates an invalid keyword message where as Call Of Duty (Wii Pre Owned) doesn't.

This is present in all of our zen sites and also in the default install / classic template.

We're currently testing a mod that auto completes the search field but a lot of our products are worded in such a way that when they are searched for in this manner the invalid keyword error arises.

29 Sep 2011, 5:17 PM
#2
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,885
Plugin Contributions:
3

Re: Search with a ( or ) in the query returns an invalid keywords error message

Hi,

Can confirm the problem in 139/15.

It is caused by some code that parses the keyword list in an attempt to find nested operators

e.g "(word1 AND (word2 OR word3))"

the same code can also in certain circumstances produce SQL errors (Thanks to RodG for pointing that out), although those SQL errors do not mean that injection is possible.

Looking at this to see the best way to fix.