Searching for "0" is treated like an empty string

VERIFIED FIXED in 1.0.2

Status

support.mozilla.org
General
VERIFIED FIXED
9 years ago
9 years ago

People

(Reporter: krupa, Assigned: paulc)

Tracking

unspecified
1.0.2
x86
Windows XP

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: sumo_only, URL)

(Reporter)

Description

9 years ago
Steps to reproduce:

1.Log into your admin account
2.Search for "0" 

expected result:
Articles with "0" in their content are listed in search results.


actual result:
-There are 1000 results listed as "100% organic software" link in footer is being indexed.

Comment 1

9 years ago
I actually think it's reading the 0 as false and treating it as an empty string.  Searching for "100" returns results for "100".
Summary: Searching for "0" returns about 1000 search results as links in footer are indexed → Searching for "0" is treated like an empty string

Updated

9 years ago
Assignee: nobody → paul.craciunoiu
(Assignee)

Comment 2

9 years ago
Yes Cheng. I changed the check from empty() to isset(). That doesn't seem to cause any problems. It's only for this case.

r24810 / r24811
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED

Comment 3

9 years ago
Where was the patch?
(Assignee)

Comment 4

9 years ago
Laura: I could submit a patch, but the change is minor. See:
http://viewvc.svn.mozilla.org/vc/projects/sumo/branches/production/webroot/tiki-newsearch.php?r1=24811&r2=24810&pathrev=24811

I changed !empty() to isset(). The difference is that isset() returns TRUE on 0, FALSE, and ''. isset() and !empty() both return TRUE on NULL.
(Assignee)

Comment 5

9 years ago
Oops, I mean both return FALSE on NULL :)
(Reporter)

Comment 6

9 years ago
Searching for "0" returns the result:
 search results for "0"
No pages matched the search criteria 

Marking this as verified
Status: RESOLVED → VERIFIED

Comment 7

9 years ago
Part of newsearch
Whiteboard: sumo_only
You need to log in before you can comment on or make changes to this bug.