git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
62a1a1a
)
Fixes #5812. =? will be detected even when it has been escaped during data serialization.
author
jaubourg
<j@ubourg.net>
Sun, 9 Jan 2011 20:48:52 +0000
(21:48 +0100)
committer
jaubourg
<j@ubourg.net>
Sun, 9 Jan 2011 20:48:52 +0000
(21:48 +0100)
src/ajax/jsonp.js
patch
|
blob
|
history
test/unit/ajax.js
patch
|
blob
|
history
diff --git
a/src/ajax/jsonp.js
b/src/ajax/jsonp.js
index
0af0056
..
f4b324e
100644
(file)
--- a/
src/ajax/jsonp.js
+++ b/
src/ajax/jsonp.js
@@
-1,7
+1,7
@@
(function( jQuery ) {
var jsc = jQuery.now(),
(function( jQuery ) {
var jsc = jQuery.now(),
- jsre = /\=\?(&|$)/,
+ jsre = /\=(?:\?|%3F)(&|$)/i,
rquery_jsonp = /\?/;
// Default jsonp settings
rquery_jsonp = /\?/;
// Default jsonp settings
diff --git
a/test/unit/ajax.js
b/test/unit/ajax.js
index
d849cff
..
773088f
100644
(file)
--- a/
test/unit/ajax.js
+++ b/
test/unit/ajax.js
@@
-1081,7
+1081,7
@@
test("jQuery.getScript(String, Function) - no callback", function() {
});
test("jQuery.ajax() - JSONP, Local", function() {
});
test("jQuery.ajax() - JSONP, Local", function() {
- expect(9);
+ expect(10);
var count = 0;
function plus(){ if ( ++count == 9 ) start(); }
var count = 0;
function plus(){ if ( ++count == 9 ) start(); }
@@
-1131,6
+1131,22
@@
test("jQuery.ajax() - JSONP, Local", function() {
jQuery.ajax({
url: "data/jsonp.php",
dataType: "jsonp",
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",
jsonp: "callback",
success: function(data){
ok( data.data, "JSON results returned (GET, data obj callback)" );
jsonp: "callback",
success: function(data){
ok( data.data, "JSON results returned (GET, data obj callback)" );