Prevents tests for replaceInData to take place if replaceInUrl is already true.

This commit is contained in:
jaubourg 2012-04-23 00:07:15 +02:00
parent 8e7aaa7fd0
commit 8ad22a2b15

View File

@ -23,7 +23,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
url = s.url,
hasCallback = s.jsonp !== false,
replaceInUrl = hasCallback && rjsonp.test( url ),
replaceInData = hasCallback && typeof data === "string" &&
replaceInData = hasCallback && !replaceInUrl && typeof data === "string" &&
!( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") &&
rjsonp.test( data );