Last Comment Bug 79655 - Internet Keywords: bypassed if "." or ":" appears in user input
: Internet Keywords: bypassed if "." or ":" appears in user input
Status: RESOLVED DUPLICATE of bug 261608
: helpwanted
Product: SeaMonkey
Classification: Client Software
Component: Search (show other bugs)
: Trunk
: All All
-- minor with 2 votes (vote)
: ---
Assigned To: Samir Gehani
: Claudius Gayle
: 112672 114892 115139 123968 135601 218918 236136 243786 (view as bug list)
Depends on:
Blocks: 127872
  Show dependency treegraph
Reported: 2001-05-09 02:38 PDT by zane
Modified: 2008-07-31 01:19 PDT (History)
17 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

untested patch. Someone please test. (2.88 KB, patch)
2002-03-20 06:56 PST, m_mozilla
no flags Details | Diff | Splinter Review
trivial tweak to comments in above patch... still untested (2.88 KB, patch)
2002-03-20 07:09 PST, m_mozilla
no flags Details | Diff | Splinter Review

Description User image zane 2001-05-09 02:38:09 PDT
What I did:
I typed the following: "ide-scsi modules.conf linux" (without the double quotes)
into my location bar, and hit return.

What happened:
I got an error message saying "ide-scsi modules.conf linux could not be found,
please check the name and try again".  If I remove the '.' from 'modules.conf' a
search is run, so I'm guessing you're using the period as an indicator that the
user has entered what they believe to be a hostname.

I also tried double quoting the string '"modules.conf"' hoping that it would
cause it to ignore the period, but this did not work.  Would be a nice
enhancement though.

What I expected:
I expected a search on google for those strings to be run, and the results
returned.  All in all, I guess I would just prefer that I could more easily
control the behaviour of the location bar - i.e. what it does when I give it
input of different kinds.
Comment 1 User image Dave 2001-05-09 11:52:15 PDT
Maybe mozilla should search for spaces as well as a "." and run a search if
there're spaces in the URL?
Comment 2 User image Dave 2001-05-09 12:06:15 PDT
This is actually a dupe of bug 73974 which is marked fixed...

*** This bug has been marked as a duplicate of 73974 ***
Comment 3 User image matt 2001-05-09 13:17:14 PDT
this is not a dup of that bug.
That bug is when a user hits the search button.
This bug is enter.  It has worked like this for years including 4.7.
Comment 4 User image Judson Valeski 2001-05-10 13:29:52 PDT
looks like we might need to do the space check before the dot check. this get's
tricky though because we might try to handle directories w/ spaces in them like:

file://Program Files or http://foo/my dir
Comment 5 User image timeless 2001-05-10 16:48:02 PDT
the http version isn't valid.  The file:// one is a problem.
Comment 6 User image Samir Gehani 2001-11-02 12:49:57 PST
Using internet keywords might help.  Enable it from the
Edit|Preferences|Navigator|SmartBrowsing pref panel.
Comment 7 User image R.K.Aa. 2001-12-12 23:22:14 PST
*** Bug 114892 has been marked as a duplicate of this bug. ***
Comment 8 User image R.K.Aa. 2001-12-13 17:31:01 PST
*** Bug 115139 has been marked as a duplicate of this bug. ***
Comment 9 User image m_mozilla 2001-12-13 18:06:10 PST
the following fix is from bug 115139 wrote:
957> PRInt32 dotLoc = hostStr.FindChar('.');
994> if(keywordsEnabled && (-1 == dotLoc)) {

The previous line 994 becomes the following two lines:

994> PRInt32 spaceLoc = hostStr.FindChar(' ');
995> if(  keywordsEnabled  && ( (spaceLoc > -1) || (-1 == dotLoc) )  ) {

that gives us the desired search functionality.

regarding Comment #4 and Comment #5 about file URLs. If I'm reading the code
correctly, this is already handled in lines 989 through 992.

    if keywords is enabled
       and there is a scheme
       and the scheme does not start with http
    then keywords will not be used

So, it sounds like this could be fixed with a nice two-line patch, eh?

The comments between lin 980 and 988 indicate that the coder wants to clean that
part up at some point, but the existing safeguard is good enough for our purposes.


PS: modified summary to include additional likely search terms and reduce dups
Comment 10 User image m_mozilla 2001-12-13 18:12:11 PST
Samir, regarding your Comment #6

This bug happens when internet keywords is enabled.

The behavior is as if they were disabled, because the code disables internet
keywords if a dot character is found in the string. This makes it impossible to
use internet keywords to search for
    Mr. Ed
    Mr. T +"download productnamehere"

I've got internet keywords set to google, and would love to use internet
keywords for all my searching, but for now, I can only use it for searches which
do not contain dot characters.

I think this is a very simple and low-risk fix.

Comment 11 User image Samir Gehani 2001-12-13 18:29:44 PST
Hey!  Wanna take this one?
Comment 12 User image m_mozilla 2001-12-13 19:08:42 PST

well, I've never "owned" a bug before... but I'm not opposed to the idea. I
should note that I'm not a C programmer. My C experience is circa 1989 (that
year, and that year only) and I'm more of a perl guy. I'm fairly sure the fix is
reasonable, but I'm infering a great deal from surrounding context. PRInt32 is
some kind of 32bit integer I'm guessing. hostStr.FindChar is searching the whole
text typed in the URL field (minus initial/trailing whitespace) I'm guessing...
but I'm not certain.

Also, I don't have the mozilla source on my computer, nor am I well-clued with
respect to CVS (understand the general principle, but never used it myself).

If I knew for certain how to get the proper version of the file in question, I'd
easily do the diff -u, but I'm not even sure of how to get the proper version of
the file in question.

So, basically, I'm saying that I could take it, but I'd need a whole lot of
hand-holding for this two line patch. Is it worth your time to do the hand
holding or would you rather just do the patch? :/

Comment 13 User image Joonas Marttila 2002-02-19 10:23:43 PST
Sorry to bug you, but how is this bug doing? Is anyone interested in making the simple patch matt 
mentions in comment #9?
Comment 14 User image benc 2002-02-27 09:52:19 PST
This flawed "dot parsing" as a way of recognizing DNS hostnames came from some
the original psuedo-spec for IK in Navigator 4.'s (#6)
examples suggest that the Mozilla implementation is very flawed.

If you want this tweek fixed, the best way to increase the priority is to test
the examples in Navigator 4. If they work in Navigator 4, then mark this w/ the
keyword 4xp.

The real solution is the implement bug 127872, which would wipe out all
syntactical vagaries.
Comment 15 User image m_mozilla 2002-02-27 10:41:43 PST
The examples *do* work in NN4.

Specifically, in v4.78 (didn't have 4.79 on this machine), if I enable IK, and
type in Mr. T. I get

with such wonderfull links as

    Mr. T. verus The Leprechaun

In mozilla build 2002022508 I get

    www.Mr. T. could not be found

I've not added a keyword before. I've put ", 4xp" on the end of the current
keywords string. We'll see if I have access to do that, and if that's in fact
how one adds a keyword...


PS: any chance this could make 0.9.9 ?
Comment 16 User image m_mozilla 2002-03-20 06:56:23 PST
Created attachment 75173 [details] [diff] [review]
untested patch. Someone please test.

I'm a perl guy. Haven't done C stuff since high school. I also don't have a
build environment to test this.

Those caveats aside, I've found where the code moved with bonsai, I've gotten
the source via lxr (not cvs) and then made what seemed to be the appropriate
edits and done a diff.

Can someone with a real build settup test this? I understand the freeze for 1.0
is less than a week out. I'd really like to see this 4.x parity issue fixed.

Many thanks :)

Comment 17 User image m_mozilla 2002-03-20 07:09:34 PST
Created attachment 75174 [details] [diff] [review]
trivial tweak to comments in above patch... still untested

modified quote style for additional phrases listed in comments to be consistent
with previously existing examples.

change only affects comments, not code
Comment 18 User image Claudius Gayle 2002-03-26 12:20:24 PST
submitting for nsbeta1
ADT, drivers, whoever's looking, can we please consider getting this in?
There is a simple patch attached. The benefits would be 4.x parity and a more
consistent behavior(the search button was already fixed to do this correctly).
Without this fix we're left with ugly and illogical results. Comment #15 is the
most straightforward example.
The URL Bar is of course the single most high-profile piece of UI and Keywords
are on by default, let's get this right.
Comment 19 User image Peter Trudelle 2002-03-26 14:26:53 PST
nsbeta1+ per Nav triage team, ->1.0, nav3
Comment 20 User image selmer (gone) 2002-04-03 14:00:07 PST
Please update this bug with an [adt1] - [adt3] impact rating (or take it off the
list if it doesn't even rate adt3.)  Thanks!
Comment 21 User image Peter Trudelle 2002-04-10 01:23:51 PDT
converting nav3->adt3
Comment 22 User image Peter Trudelle 2002-04-17 17:33:12 PDT
Mass moving nsbeta1+/adt3 bugs assigned to Navigator team engineers out to
target milestone 1.0.1.  Please confine your attentions to driving down our list
of TM 1.0 bugs for beta.  Better to help, debug, or test one of them than fix
one of these.
Comment 23 User image scottputterman 2002-04-22 19:31:28 PDT
Changing nsbeta1+ [adt3] bugs to nsbeta1- on behalf of the adt.  If you have any
questions about this, please email  You can search for
"changing adt3 bugs" to quickly find and delete these bug mails.
Comment 24 User image scottputterman 2002-04-22 19:51:06 PDT
Changing nsbeta1+ [adt3] bugs to nsbeta1- on behalf of the adt.  If you have any
questions about this, please email  You can search for
"changing adt3 bugs" to quickly find and delete these bug mails.
Comment 25 User image John Levon 2002-04-24 11:51:58 PDT
*** Bug 135601 has been marked as a duplicate of this bug. ***
Comment 26 User image John Levon 2002-04-25 13:51:50 PDT
*** Bug 123968 has been marked as a duplicate of this bug. ***
Comment 27 User image u60234 2002-11-23 14:37:12 PST
*** Bug 112672 has been marked as a duplicate of this bug. ***
Comment 28 User image benc 2002-12-17 18:53:38 PST
asa asked me to look into some aspects of this problem, so here is my update:

As other people have noted, "." causes IK to be bypassed, even if other
characters that should logically force a IK lookup (most notably spaces) are

There are actually two problems here, and I'll illustrate by example:

"what is 3.14159" - should go to internet keywords, but instead is errored as
"an invalid protocol". Anything with spaces should go to IK if it is on (and
give this protocol error if this is off). In comparison, "what is 3" goes to
Internet Keywords.

"3.14159" - should go to DNS. If DNS fails with "hostname not found", then it
should be sent to Internet Keywords. In comparison, a single word, presumed to
be a hostname, is sent to DNS and then IK. In comparison, "3" will fail, and
then be sent to the keyword server.

In other words, the general expectation is that Internet Keywords should be used
 in two cases:
1- Whenever it is obvious (spaces is a giveaway), that the user typed something
that cannot be resolved in DNS.
2- Whenever DNS was searched and "hostname not found" was returned.

Right now, IK is sometimes used when it should not, and not used when it should.
Comment 29 User image Vedran Miletic 2003-10-05 07:56:28 PDT
Comment 30 User image Asa Dotzler [:asa] 2003-10-05 15:16:01 PDT
Vedran Miletic, the target milestone field belongs to the bug assignee. Please
stop changing fields in Bugzilla. Thank you.
Comment 31 User image Asa Dotzler [:asa] 2004-03-02 21:48:11 PST
*** Bug 218918 has been marked as a duplicate of this bug. ***
Comment 32 User image Asa Dotzler [:asa] 2004-03-02 21:48:35 PST
*** Bug 236136 has been marked as a duplicate of this bug. ***
Comment 33 User image Fredrik Öhrn 2004-03-03 03:20:17 PST
(In reply to comment #32)
> *** Bug 236136 has been marked as a duplicate of this bug. ***

Bug 236136 notes that : (colon) doesn't work in keyword search, maby the summary
of this bug can be updated to include both . and :

Comment 34 User image :Gavin Sharp [email:] 2004-09-17 12:26:11 PDT
*** Bug 243786 has been marked as a duplicate of this bug. ***
Comment 35 User image Jeff Walden [:Waldo] (remove +bmo to email) 2004-12-06 00:56:07 PST
A couple months ago, I filed bug 261608, which is pretty much a dup of this one.
 However, I also did the work to create a patch, and I posted the patch pretty
quickly.  After a few iterations of review I finally got r/sr, and it was
checked in a few days ago.  With the patch checked in, this bug should now be
fixed.  If after testing some trunk nightlies people here agree this is so,
please mark this bug as a duplicate of bug 261608.  Thanks!
Comment 36 User image :Gavin Sharp [email:] 2004-12-06 00:59:02 PST

*** This bug has been marked as a duplicate of 261608 ***
Comment 37 User image Elliotte Rusty Harold 2005-09-19 11:11:25 PDT
I don't appear to have an option to reopen this bug but it's not fully fixed
yet. In the latest Firefox beta a search for "Java 1.5" works. However a search
for "javax.usb" fails with a "Server not found". Similarly a search for
"java:test is a sample" fails with "Firefox doesn't know how to open this
address, because the protocol (java) isn't associated with any program." On the
other hand "sample java:test is a sample" succeeds. 

I think that is it isn't obviously a bad URL, then Firefox should default to a
search for the term (at least if keyword seacrh is enabled) 

Note You need to log in before you can comment on or make changes to this bug.