mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fix for bug #1638, where a non-string data could break an Ajax request.
This commit is contained in:
parent
14b88f6019
commit
80a26a3266
@ -174,12 +174,12 @@ jQuery.extend({
|
||||
}
|
||||
|
||||
// Build temporary JSONP function
|
||||
if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
|
||||
if ( s.dataType == "json" && (s.data && jsre.test( s.data ) || s.url.match(jsre)) ) {
|
||||
jsonp = "jsonp" + jsc++;
|
||||
|
||||
// Replace the =? sequence both in the query string and the data
|
||||
if ( s.data )
|
||||
s.data = s.data.replace(jsre, "=" + jsonp);
|
||||
s.data = (s.data + "").replace(jsre, "=" + jsonp);
|
||||
s.url = s.url.replace(jsre, "=" + jsonp);
|
||||
|
||||
// We need to make sure
|
||||
|
Loading…
Reference in New Issue
Block a user