Closed Bug 489399 Opened 15 years ago Closed 15 years ago

Searching for "0" is treated like an empty string

Categories

(support.mozilla.org :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: krupa.mozbugs, Assigned: paulc)

References

()

Details

(Whiteboard: sumo_only)

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.
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
Assignee: nobody → paul.craciunoiu
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
Closed: 15 years ago
Resolution: --- → FIXED
Where was the patch?
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.
Oops, I mean both return FALSE on NULL :)
Searching for "0" returns the result:
 search results for "0"
No pages matched the search criteria 

Marking this as verified
Status: RESOLVED → VERIFIED
Part of newsearch
Whiteboard: sumo_only
You need to log in before you can comment on or make changes to this bug.