diff options
author | jaubourg <j@ubourg.net> | 2011-01-12 18:36:00 +0100 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2011-01-12 18:36:00 +0100 |
commit | 0c51e9d55f39366cab14719b80cb7e989c716351 (patch) | |
tree | e602d1bcd82989b883443994eaa1970b9e86773c /test/data/jsonp.php | |
parent | f83cdc3c4c134b2796335e9f9806f3b67e7ca87f (diff) | |
download | jquery-0c51e9d55f39366cab14719b80cb7e989c716351.tar.gz jquery-0c51e9d55f39366cab14719b80cb7e989c716351.zip |
Fixes #4897. Added ?? as a context-insensitive placeholder for the callback name of a JSONP request. Unit tests provided.
Diffstat (limited to 'test/data/jsonp.php')
-rw-r--r-- | test/data/jsonp.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/data/jsonp.php b/test/data/jsonp.php index 9ae1d8487..6c13d72e9 100644 --- a/test/data/jsonp.php +++ b/test/data/jsonp.php @@ -1,6 +1,10 @@ <?php error_reporting(0); $callback = $_REQUEST['callback']; +if ( ! $callback ) { + $callback = explode("?",end(explode("/",$_SERVER['REQUEST_URI']))); + $callback = $callback[0]; +} $json = $_REQUEST['json']; if($json) { echo $callback . '([ {"name": "John", "age": 21}, {"name": "Peter", "age": 25 } ])'; |