Closed
Bug 188237
Opened 23 years ago
Closed 23 years ago
Unable to href to local file containing '?' in filename
Categories
(Core :: Networking: File, defect)
Tracking
()
VERIFIED
DUPLICATE
of bug 102603
People
(Reporter: t.bubeck, Assigned: dougt)
Details
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021203
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021203
Writing a href which points to a local file containing '?' in its name and
accessing the link results in mozilla showing: The file /tmp/a?b cannot be
found (e.g. <a href="file:///tmp/a?b">).
What I found out:
=================
According to rfc1738 section 5 it is allowed to use the character '?' (and
many others in local filenames):
; FILE
fileurl = "file://" [ host | "localhost" ] "/" fpath
; FTP (see also RFC959)
ftpurl = "ftp://" login [ "/" fpath [ ";type=" ftptype ]]
fpath = fsegment *[ "/" fsegment ]
fsegment = *[ uchar | "?" | ":" | "@" | "&" | "=" ]
ftptype = "A" | "I" | "D" | "a" | "i" | "d"
It seems, that mozilla is cutting off any part of a local filename including
and following the '?'. This means, that file:///tmp/a?b and file:///tmp/a are
treated equal.
Maybe this bug is a duplicate or something similar to BUG #161352 ?
This bug occurs, when trying to access local copies from web sites retrieved
with "wget" if the site uses "php" or anything else using parameters...
Reproducible: Always
Steps to Reproduce:
1. write a page pointing to file:///tmp/a?b
2. touch '/tmp/a?b'
3. Access the link
Actual Results:
The file /tmp/a?b cannot be found.
Expected Results:
Open the page without any error
Reporter | ||
Comment 1•23 years ago
|
||
The bug also occurs on mozilla-1.3a.
Comment 2•23 years ago
|
||
If you consult with RFC2396, wich is updated RFC1738, you could find:
3.3. Path Component
The path may consist of a sequence of path segments separated by a
single slash "/" character. Within a path segment, the characters
"/", ";", "=", and "?" are reserved. Each path segment may include a
sequence of parameters, indicated by the semicolon ";" character.
The parameters are not significant to the parsing of relative
references.
I think RFC2396 should be taking in prior for this case.
![]() |
||
Updated•23 years ago
|
Whiteboard: DUPEME
Please try escaping the "?"
if you agree w/ my dupe, then please VERIFY this bug.
*** This bug has been marked as a duplicate of 102603 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Reporter | ||
Comment 4•23 years ago
|
||
You are right. '?' (and others) should be escaped. I tried it and everything
worked. No bug in Mozilla. Sorry for "disturbing"... :-)
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•