Fixes #4897. Added ?? as a context-insensitive placeholder for the callback name of a JSONP request. Unit tests provided.
This commit is contained in:
parent
f83cdc3c4c
commit
0c51e9d55f
3 changed files with 62 additions and 5 deletions
|
@ -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 } ])';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue