api: disable deprecated HTTP parameter support by default

This commit is contained in:
Andrew Dolgov 2012-08-17 15:16:13 +04:00
parent 369dbc19d6
commit 6eaf319320
1 changed files with 10 additions and 4 deletions

View File

@ -29,12 +29,18 @@
$input = file_get_contents("php://input"); $input = file_get_contents("php://input");
if (defined('_API_DEBUG_HTTP_ENABLED') && _API_DEBUG_HTTP_ENABLED) {
// Override $_REQUEST with JSON-encoded data if available // Override $_REQUEST with JSON-encoded data if available
// fallback on HTTP parameters
if ($input) { if ($input) {
$input = json_decode($input, true); $input = json_decode($input, true);
if ($input) $_REQUEST = $input; if ($input) $_REQUEST = $input;
} }
} else {
// Accept JSON only
$input = json_decode($input, true);
$_REQUEST = $input;
}
if ($_REQUEST["sid"]) { if ($_REQUEST["sid"]) {
session_id($_REQUEST["sid"]); session_id($_REQUEST["sid"]);