Closed Bug 75063 Opened 24 years ago Closed 24 years ago

Typing mozilla.org\ gives unexpected results.

Categories

(Core :: DOM: Navigation, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9.2

People

(Reporter: neil, Assigned: adamlock)

References

Details

Attachments

(4 files)

If you type mozilla.org\ into the location bar and press enter, it selects the ftp:// protocol and adds three forward slashes to the end. file://mozilla.org/// And it also tries to display the www page as an FTP site. I don't know if this is a bug, but I sure didn't expect that to happen.
over to Networking. In Linux build 040908 we escape the backslash and load the page fine but not on win2K.
Assignee: asa → neeti
Status: UNCONFIRMED → NEW
Component: Browser-General → Networking: HTTP
Ever confirmed: true
QA Contact: doronr → tever
Target Milestone: --- → mozilla0.9.1
We are converting to file:// protocol in docshell\base\nsDefaultURIFixup.cpp in nsDefaultURIFixup::CreateFixupURI(..)
Assignee: neeti → adamlock
Component: Networking: HTTP → Embedding: Docshell
The method nsDefaultURIFixup::ConvertFileToStringURI is doing the fixup. If it sees a backslash in the string or the string length is 2 and the last char is a colon or a bar then it converts it to a file URL. This is meant to be smart behaviour to account for people typing file paths into the address base. Perhaps it would be smarter it it worked on absolute paths e.g. "c:\blah\" & "\somewhere" but "..\foo\" and "bar\" would be skipped. It could even test if the file/dir actually exists. Obviously this is all Win32 specific. For some reason, the Unix version would turn this "\somepath" into this "file://\somepath". Is this legal?
Backslashes are allowed in names, at least on Linux ext2 filesystems. touch '\a\b.zz' will create such a file so mozilla's behavior is correct on Linux.
Review please for the patch. The patch turns the input URL into a file:// URL if it refers to an existing file with an absolute path. So things like "c:\", "d:\mozilla\somefile.txt" will be transformed into their "file://c|/" and "file://d|/mozilla/somefile.txt" equivalents, but "mozilla.org\" will still turn into "http://mozilla.org/".
-> 0.9.2
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Attached patch Updated patchSplinter Review
Blocks: 81066
r=valeski
sr=rpotts
Thanks everyone, fix is checked in.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Filed bug 81717 for this still happening for data: (and finger:) urls.
qa to me. +verifyme (will verify when I do all 0.9.x fixes)
Keywords: verifyme
QA Contact: tever → benc
Is this windows-only behavior?
mass remove verifyme requests greater than 4 months old
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: