mirror of
https://github.com/jquery/jquery.git
synced 2026-02-05 20:45:02 -05:00
Coerce s.url to string before calling replace, since replace is also a method of a Location object. Fixes #7531.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user