Handle a falsy URL in the settings object for jQuery.ajax. Fixes #10093, Closes gh-979

This commit is contained in:
Ben Truyman
2012-10-16 11:37:15 -04:00
committed by Rick Waldron
parent fcaef88968
commit ce5784a480
2 changed files with 39 additions and 3 deletions

View File

@@ -247,6 +247,7 @@ jQuery.extend({
target = jQuery.ajaxSettings;
}
ajaxExtend( target, settings );
return target;
},
@@ -557,8 +558,9 @@ jQuery.extend({
// Remove hash character (#7531: and string promotion)
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
// Handle falsy url in the settings object (#10093: consistency with old signature)
// We also use the url parameter if available
s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
// Extract dataTypes list
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( core_rspace );