foreverqihe / reallysimplehistory

Automatically exported from code.google.com/p/reallysimplehistory
Other
0 stars 1 forks source link

Apostrophe in URL does not match in Firefox; results in endless location changes #68

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In Firefox, visit a url with an apostrophe
2. In the checkLocation function, the equality check "hash =
this.currentLocation" fails because the apostrophe url is alternately
encoded as "%27" and "'"
3.

What is the expected output? What do you see instead?
Expected: navigating to the page triggers a single history change event.
Instead, the history change event is invoked repeatedly because rsh always
thinks that the URL is changing.

Suggested fix: 
Add to checkLocation:
    /*Get hash location*/
    var hash = this.getCurrentLocation();
    if (Prototype.Browser.Gecko)    // or any other check for Firefox
      hash = hash.replace(/'/g, "%27");   // added

Original issue reported on code.google.com by ajshan...@gmail.com on 25 Sep 2008 at 8:51