Bug 15182
Summary: | window.location.hash contains URL-encoded hash value | ||
---|---|---|---|
Product: | WebKit | Reporter: | Tim Buckingham <tim> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | ap, barraclough, jhanssen, mrowe |
Priority: | P2 | Keywords: | InRadar |
Version: | 523.x (Safari 3) | ||
Hardware: | All | ||
OS: | OS X 10.4 |
Tim Buckingham
Stumbled upon a bug when working in #webkit with bdash.
When reading window.location.hash in Javascript characters are not URL decoded as they are in other browsers. For example, trying to split #this|two|three when it is #this%7Ctwo%7Cthree fails in WebKit, but works fine in other browsers.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Mark Rowe (bdash)
To reproduce:
1. Visit http://www.google.com.au/#%7C
2. Enter javascript:alert(location.hash) in the address bar.
Safari displays '#%7C'. Camino displays '#|'.
Mark Rowe (bdash)
<rdar://problem/5474669>
Jan Erik Hanssen
The Mozilla people seems to think that their behavior (urldecoding window.location.hash) is a bug: https://bugzilla.mozilla.org/show_bug.cgi?id=483304. Also, Opera does not urldecode this.
Gavin Barraclough
Based on Jan Erik Hanssen's comment, plus teh fact we match Opera & Chrome, looks like our behaviour is correct.