Closed Bug 228103 Opened 19 years ago Closed 19 years ago

Toolbar Google search for empty string results in garbage characters


(Firefox :: Toolbars and Customization, defect)

Not set





(Reporter: andersk, Assigned: p_ch)



(Keywords: regression)


(2 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031206 Firebird/0.7+
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031206 Firebird/0.7+

When I use the Google search box in the toolbar to search for an empty string, I
instead get a Google search for random garbage characters. I just got:
although the exact characters change every time.

Reproducible: Always

Steps to Reproduce:
1. Go to the Google search box, delete anything that's there, and press Enter.
Actual Results:  
Google search for garbage characters.

Expected Results:  
I'm not sure -- maybe nothing at all, maybe open, maybe Google
search for nothing (that's pointless, so probably not).

I'm using the latest Firebird GTK2 nightly in Fedora Core 1.
Confirming. I see this on WinXP as well.
Mozilla doesn't let you search unless you enter something.
Ever confirmed: true
OS: Linux → All
Ben should take a look.

Assignee: hyatt → bugs
WORKS:  2003120401
BROKEN: 2003120502
Keywords: regression
Jungshik, your checkin for bug 225695 was within the regression window and fixed
a problem with the search bar (it didn't work for non-ASCII searches).

I get different characters each time.  Once I got 
"?????? NC:BrowserMore5CharsetMenuRoot" 
where the ?'s were symbols from various languages.  It seems to be reading a
string from a random memory location.
Ben, you better be reading bugmail!

Flags: blocking0.8?
The random string is returned by encodeURIComponent in search.xml
(browser/base/content). A quick fix would be to replace 
encodeURIComponent(this.value) with 

this.value == "" ? "" : encodeURIComponent(this.value) 


However, I think we need to warn users that they have to type in something as is
done in search sidebar in Mozilla. Besides, encodeURIComponent() has to be fixed
as well, doesn't it?
encodeURIComponent does need to be fixed, but I think this quick fix is okay
for the 0.8 branch given that time is short.  Searching on a blank string will
redirect to
which doesn't require a warning at all.
Attachment #137877 - Flags: review?(p_ch)
A fix as simple as this one, as jshin suggested, would be to not load google
when the query string is empty. There's no need to warn the user, let's do just
nothing in this case. That's a fix we could include also in the trunk.
Mike, could you come up with a patch? I'll review and check it in both trunk and
I just happened to be sitting in front of my computer on Christmas eve and made
a patch as you suggested :-) I haven't tested it yet (my tree needs some
update), but should be fine.
Please don't change functionality just because of this bug. I frequently use
blank search + enter to get to Google, and I'm 100% sure that this is the
desired functionality for most users.
I agree with comment #10, as we have had this functionality for quite some time
and it is a very useful way to get to Google quickly.  I think we should try to
keep this functionality when fixing this.
Did it take you to or to
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7a) Gecko/20040107 Firebird/0.7+
(daihard; XFT+GTK2; optimized for P4/SSE-2)

The above URL is what appears when Enter is pressed with an empty field.
WORKS:  2003120401
BROKEN: 2003120409

rhino side problem?
Nothing to do with rhino. Sorry for bug spam.
yeah. encodeURIComponent() has to be fixed.
Depends on: 225695
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115 Firebird/0.7+

The above build is a branch build.
Assignee: bugs → p_ch
I fixed it (trunk and branch) so that querying for the empty string loads the
host of the search site.
loading the empty string is not really acceptable, since some search sites
report  an error.
Closed: 19 years ago
Resolution: --- → FIXED
Attachment #137877 - Flags: review?(p_ch)
Is there a bug filed for the bug in encodeURIComponent?
Jesse: I just filed bug 232223
Flags: blocking0.8?
QA Contact: bugzilla → toolbars
You need to log in before you can comment on or make changes to this bug.