Toolbar Google search for empty string results in garbage characters




15 years ago
7 years ago


(Reporter: andersk, Assigned: p_ch)


(Depends on: 1 bug, {regression})

Firefox Tracking Flags

(Not tracked)



(2 attachments)



15 years ago
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.

Comment 1

15 years ago
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

Comment 3

15 years ago
WORKS:  2003120401
BROKEN: 2003120502
Keywords: regression

Comment 4

15 years ago
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?

Comment 6

15 years ago
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?
Created attachment 137877 [details] [diff] [review]
patch based on comment 6

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.


15 years ago
Attachment #137877 - Flags: review?(p_ch)

Comment 8

15 years ago
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

Comment 9

15 years ago
Created attachment 137920 [details] [diff] [review]
1-liner patch as suggested by Pierre

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.

Comment 10

15 years ago
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.

Comment 11

15 years ago
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.

Comment 12

15 years ago
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.

Comment 15

15 years ago
WORKS:  2003120401
BROKEN: 2003120409

rhino side problem?

Comment 16

15 years ago
Nothing to do with rhino. Sorry for bug spam.

Comment 17

15 years ago
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.

Comment 19

15 years ago
Assignee: bugs → p_ch

Comment 20

15 years ago
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.
Last Resolved: 15 years ago
Resolution: --- → FIXED


15 years ago
Attachment #137877 - Flags: review?(p_ch)

Comment 21

15 years ago
Is there a bug filed for the bug in encodeURIComponent?

Comment 22

15 years ago
Jesse: I just filed bug 232223


15 years ago
Flags: blocking0.8?
Removing self from CC list.


12 years ago
QA Contact: bugzilla → toolbars
You need to log in before you can comment on or make changes to this bug.