If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Search Sanitization Problem

Search Sanitization Problem

Started by dbltoe on 11 Feb 2026, 6:12 PM · Views: 956

Results 1 to 3 of 3
11 Feb 2026, 6:12 PM
#1
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,908
Plugin Contributions:
23

Post #1 by dbltoe

This "problem" is found in 1.5.8 thru 2.2.0-alpha with no change based on assigned PHP.

No matter which of the three search options (basic, mod, or bootstrap ajax), the search does not like ( or other characters that might be part of code) and completely drops the search when used.

It's a trend online these days to show the customer the aisle and bin number for the product. In a site with thousands of items, a code is added to the end of the product's name which represents the warehouse location of the product. i.e., widget-81 (3A4)

While this is immensely helpful to the shipping department, customers who have ordered before will tend to search for the item rather than go into their account (IF they have one) and order from there.

If they enter widget-81, there's no problem. If they add the space, no problem. If they add the opening parentheses "(", the search fails. In the case of the ajax search in bootstrap (and apparently the basic and mod versions) the sanitizing is done in Zen Cart core.

I can modify bootstrap files to accept the (, but Zen Cart core still has a problem with it when doing an advanced search or View All from the ajax search.

If the judgement is to not allow core to accept certain characters, is there a way to make a site-specific change to allow those characters on a store-by-store situation?

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

12 Feb 2026, 12:19 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,144
Plugin Contributions:
56

Post #2 by lat9

Parentheses are part of the search's formatting, e.g. ```
this and (that or "the other")

That's going to make it "very difficult" to parse out when an open-/close-parenthesis is part of the search keyword.
12 Feb 2026, 2:29 PM
#3
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,908
Plugin Contributions:
23

Post #3 by dbltoe

I have it working with Ajax in Bootstrap for a basic search. Doing an advanced search or clicking on View All results in an Invalid keywords warning due to the core sanitization, with no log file created.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com