Skip to content

Commit

Permalink
Fixes #5812. =? will be detected even when it has been escaped during…
Browse files Browse the repository at this point in the history
… data serialization.
  • Loading branch information
jaubourg committed Jan 9, 2011
1 parent 62a1a1a commit 8c8bd3b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ajax/jsonp.js
@@ -1,7 +1,7 @@
(function( jQuery ) {

var jsc = jQuery.now(),
jsre = /\=\?(&|$)/,
jsre = /\=(?:\?|%3F)(&|$)/i,
rquery_jsonp = /\?/;

// Default jsonp settings
Expand Down
18 changes: 17 additions & 1 deletion test/unit/ajax.js
Expand Up @@ -1081,7 +1081,7 @@ test("jQuery.getScript(String, Function) - no callback", function() {
});

test("jQuery.ajax() - JSONP, Local", function() {
expect(9);
expect(10);

var count = 0;
function plus(){ if ( ++count == 9 ) start(); }
Expand Down Expand Up @@ -1128,6 +1128,22 @@ test("jQuery.ajax() - JSONP, Local", function() {
}
});

jQuery.ajax({
url: "data/jsonp.php",
dataType: "jsonp",
data: {
callback: "?"
},
success: function(data){
ok( data.data, "JSON results returned (GET, processed data callback)" );
plus();
},
error: function(data){
ok( false, "Ajax error JSON (GET, processed data callback)" );
plus();
}
});

jQuery.ajax({
url: "data/jsonp.php",
dataType: "jsonp",
Expand Down

0 comments on commit 8c8bd3b

Please sign in to comment.