If this is your first visit, check our documentation. To post, register or login.
Forums / Code Matters / Bug Reports / [Fixed v1.5.1] Improper handling of '0' as search keyword

[Fixed v1.5.1] Improper handling of '0' as search keyword

Locked

Started by data_digger on 6 Feb 2012, 5:21 PM · Views: 708

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
6 Feb 2012, 5:21 PM
#1
data_digger avatar

data_digger

Zen Follower

Join Date:
Jan 2009
Posts:
222
Plugin Contributions:
2

Post #1 by data_digger

Hello,

I'm not sure which versions exactly are affected but I know that the bug exists at least since 1.3.8a till 1.5.0.

When search keywords contain single '0' character (for example "oven 0') the '0' is incorrectly casted to boolean falase in includes/functions/functions_general.php line 373 (in version 1.5.0):

} elseif ( ($objects[$i]) && ($objects[$i] != '(') && ($objects[$i] != ')') ) {
``` and search fails.
Quick fix:
```php
} elseif ( (is_string($objects[$i]) && $objects[$i] == '0') || ($objects[$i]) && ($objects[$i] != '(') && ($objects[$i] != ')') ) {
19 Sep 2012, 2:52 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #2 by drbyte

Fixed in v1.5.1

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.