1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 03:15:56 +00:00

cleanup some defined-stuff

This commit is contained in:
Andrew Dolgov
2021-02-23 09:01:27 +03:00
parent 5229cc58b2
commit 2ae0b7059f
12 changed files with 32 additions and 44 deletions

View File

@@ -8,7 +8,6 @@
chdir("..");
define('TTRSS_SESSION_NAME', 'ttrss_api_sid');
define('NO_SESSION_AUTOSTART', true);
require_once "autoload.php";
@@ -20,26 +19,11 @@
ob_start();
$input = file_get_contents("php://input");
if (defined('_API_DEBUG_HTTP_ENABLED') && _API_DEBUG_HTTP_ENABLED) {
// Override $_REQUEST with JSON-encoded data if available
// fallback on HTTP parameters
if ($input) {
$input = json_decode($input, true);
if ($input) $_REQUEST = $input;
}
} else {
// Accept JSON only
$input = json_decode((string)$input, true);
$_REQUEST = $input;
}
$_REQUEST = json_decode((string)file_get_contents("php://input"), true);
if (!empty($_REQUEST["sid"])) {
session_id($_REQUEST["sid"]);
@session_start();
} else if (defined('_API_DEBUG_HTTP_ENABLED')) {
@session_start();
}
startup_gettext();