diff options
author | Ben Truyman <bentruyman@gmail.com> | 2012-10-16 11:37:15 -0400 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2012-10-16 11:37:15 -0400 |
commit | ce5784a480ee6dc355fc961ab8bcd5828dabcbb6 (patch) | |
tree | 0ebf73c24d1e2736811b0f39b114fc1b8b1d8823 /src | |
parent | fcaef889682d6724f7b8e662c66a7539a95ae3d8 (diff) | |
download | jquery-ce5784a480ee6dc355fc961ab8bcd5828dabcbb6.tar.gz jquery-ce5784a480ee6dc355fc961ab8bcd5828dabcbb6.zip |
Handle a falsy URL in the settings object for jQuery.ajax. Fixes #10093, Closes gh-979
Diffstat (limited to 'src')
-rw-r--r-- | src/ajax.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ajax.js b/src/ajax.js index 394c84e66..3f71f8c6e 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -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 ); |