Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix($browser/$location): single quote in url causes infinite digest in F... #954

Merged
merged 1 commit into from
May 14, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ng/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ function Browser(window, document, $log, $sniffer) {
return self;
// getter
} else {
return location.href;
// the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172
return location.href.replace(/%27/g,"'");
}
};

Expand Down
6 changes: 6 additions & 0 deletions test/ng/browserSpecs.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,12 @@ describe('browser', function() {
it('should return $browser to allow chaining', function() {
expect(browser.url('http://any.com')).toBe(browser);
});


it('should decode single quotes to work around FF bug 407273', function() {
fakeWindow.location.href = "http://ff-bug/?single%27quote";
expect(browser.url()).toBe("http://ff-bug/?single'quote");
});
});

describe('urlChange', function() {
Expand Down