Closed Bug 228103 Opened 19 years ago Closed 19 years ago

Toolbar Google search for empty string results in garbage characters

Categories

(Firefox :: Toolbars and Customization, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: andersk, Assigned: p_ch)

References

Details

(Keywords: regression)

Attachments

(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:
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.
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
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!

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

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?
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.
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
branch.
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 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.
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+
(.: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.
taking
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.
Status: NEW → RESOLVED
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.