"fix" otpoll.php
This commit is contained in:
parent
9bf29b2913
commit
ae7a970b50
@ -51,6 +51,13 @@ function bogusSession($i){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$command = isset($_POST['command']) ? $_POST['command'] : '';
|
$command = isset($_POST['command']) ? $_POST['command'] : '';
|
||||||
|
// sorry - but currently the whole body is the message...
|
||||||
|
$postbody = file_get_contents('php://input');
|
||||||
|
if (preg_match('/(^[^:]*):/', $postbody, $matches)) {
|
||||||
|
$command = $matches[1];
|
||||||
|
} else {
|
||||||
|
$command = '';
|
||||||
|
}
|
||||||
|
|
||||||
$response = array();
|
$response = array();
|
||||||
switch ($command){
|
switch ($command){
|
||||||
@ -58,7 +65,7 @@ switch ($command){
|
|||||||
$response["session_list"] = array(bogusSession(0), bogusSession(1));
|
$response["session_list"] = array(bogusSession(0), bogusSession(1));
|
||||||
break;
|
break;
|
||||||
case 'join-session':
|
case 'join-session':
|
||||||
|
$response = "true"; // should fail when session is non-existent
|
||||||
break;
|
break;
|
||||||
case 'sync-ops':
|
case 'sync-ops':
|
||||||
// completely bogus
|
// completely bogus
|
||||||
@ -82,6 +89,9 @@ switch ($command){
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
header('HTTP/1.1 400: BAD REQUEST');
|
header('HTTP/1.1 400: BAD REQUEST');
|
||||||
|
print("");
|
||||||
|
print("bad request: [$command]");
|
||||||
|
print("");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user