Toolbar Google search for empty string results in garbage characters

RESOLVED FIXED

Status

()

RESOLVED FIXED
15 years ago
7 years ago

People

(Reporter: andersk, Assigned: p_ch)

Tracking

(Depends on: 1 bug, {regression})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

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:
http://www.google.com/search?q=%E8%86%90I%E3%88%88%E0%A6%99%10&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8
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 www.google.com, 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.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Ben should take a look.

/be
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!

/be
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) 

at http://lxr.mozilla.org/mozilla/source/browser/base/content/search.xml#138

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
http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=utf-8&q=&btnG=Google+Search
which doesn't require a warning at all.

Updated

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

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
branch.

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 http://www.google.com/search?q= or to http://www.google.com/
before?
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)

http://www.google.com/search?q=%E1%8B%90%E4%82%97%EC%8C%98%E0%A5%82%10&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8

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+
(.:MrC:.)

http://www.google.com/search?q=%E9%8B%90%E4%81%BC%E1%89%A0%E0%A2%91%10&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8

The above build is a branch build.
(Assignee)

Comment 19

15 years ago
taking
Assignee: bugs → p_ch
(Assignee)

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.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
(Assignee)

Updated

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

Comment 21

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

Comment 22

15 years ago
Jesse: I just filed bug 232223

Updated

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

Updated

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