aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorColin Snover <github.com@zetafleet.com>2010-11-17 00:59:24 -0600
committerColin Snover <github.com@zetafleet.com>2010-11-17 00:59:24 -0600
commit2a0c7d702b83a6b2e40eb79a5d6ea94d74f3090d (patch)
tree42bb3ac925fa39198b24a051ee75e0e2d31ee2ff /src
parent0838bdf52cf9f27ebc2bbee74fd7170e2d854c11 (diff)
downloadjquery-2a0c7d702b83a6b2e40eb79a5d6ea94d74f3090d.tar.gz
jquery-2a0c7d702b83a6b2e40eb79a5d6ea94d74f3090d.zip
Coerce s.url to string before calling replace, since replace is also a method of a Location object. Fixes #7531.
Diffstat (limited to 'src')
-rw-r--r--src/ajax.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ajax.js b/src/ajax.js
index d10b93112..61b9c438e 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -198,7 +198,10 @@ jQuery.extend({
var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings),
jsonp, status, data, type = s.type.toUpperCase(), noContent = rnoContent.test(type);
- s.url = s.url.replace( rhash, "" );
+ // toString fixes people passing a window.location or
+ // document.location to $.ajax, which worked in 1.4.2 and
+ // earlier (bug #7531). It should be removed in 1.5.
+ s.url = s.url.toString().replace( rhash, "" );
// Use original (not extended) context object if it was provided
s.context = origSettings && origSettings.context != null ? origSettings.context : s;