Closed
Bug 656691
Opened 13 years ago
Closed 13 years ago
Setting location.hash mangles URLs with escaped characters
Categories
(Core :: Networking, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 622981
People
(Reporter: gregvalure, Unassigned)
Details
Attachments
(1 file)
216 bytes,
text/html
|
Details |
The attached HTML file sets location.hash to "test" on body.onload and window.onhashchange. If the path has a space in it and you set the URL to end in #, the URL will get mangled. It doesn't happen in any other situation. 1. Open the attached file. URL bar shows file:///C:/Temp/a a.html, it correctly gets changed to file:///C:/Temp/a a.html#test. 2. Open file:///C:/Temp/a a.html#foo, it correctly gets changed to file:///C:/Temp/a a.html#test 3. Open file:///C:/Temp/a a.html#, it incorrectly gets changed to file:///C:/Temp/a a.htmtestl# 4. If the file is renamed to aa.html, opening file:///C:/Temp/aa.html# makes it correctly get changed to file:///C:/Temp/aa.html#test 5. If the file is renamed to a a a.html, opening file:///C:/Temp/a a a.html# makes it incorrectly change to file:///c:/temp/a a a.htesttml# Since adding a space made it shift left two characters and two spaces shifted it four, I'm guessing the code for the special case of "#" is taking a string index from the unescaped URL and using it to insert into an escaped URL string. Using Firefox 4.0.1.
Reporter | ||
Comment 1•13 years ago
|
||
Comment 2•13 years ago
|
||
jesup, I assume your recent patch fixed this, right?
Comment 3•13 years ago
|
||
Er, and ccing rjesup. See comment 2.
Assignee: ashuk → nobody
Component: Java APIs for DOM → Networking
QA Contact: dom-apis → networking
Comment 4•13 years ago
|
||
This is the same problem as bug 622981 - the space gets encoded causing the issue. Tried it on a trunk build (on linux though) and the problem does not appear.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•