summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-09 08:47:41 +0300
committerAndrew Dolgov <[email protected]>2021-02-09 08:47:41 +0300
commitaba028a37539f830f7298dd516d3e27973c2151c (patch)
tree4f4456f26f2d29456becfc4c19876091d23c8d2d /api
parentf6f0f216641c2e47f429a05f0d5e2c39d0cd8f89 (diff)
api: fix some php8 warnings (3)
Diffstat (limited to 'api')
-rw-r--r--api/index.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/api/index.php b/api/index.php
index 8e85919c6..77552af46 100644
--- a/api/index.php
+++ b/api/index.php
@@ -41,11 +41,11 @@
}
} else {
// Accept JSON only
- $input = json_decode($input, true);
+ $input = json_decode((string)$input, true);
$_REQUEST = $input;
}
- if ($_REQUEST["sid"]) {
+ if (!empty($_REQUEST["sid"])) {
session_id($_REQUEST["sid"]);
@session_start();
} else if (defined('_API_DEBUG_HTTP_ENABLED')) {
@@ -56,7 +56,7 @@
if (!init_plugins()) return;
- if ($_SESSION["uid"]) {
+ if (!empty($_SESSION["uid"])) {
if (!validate_session()) {
header("Content-Type: text/json");
@@ -67,7 +67,7 @@
return;
}
- UserHelper::load_user_plugins( $_SESSION["uid"]);
+ UserHelper::load_user_plugins($_SESSION["uid"]);
}
$method = strtolower($_REQUEST["op"]);
@@ -77,7 +77,7 @@
if ($handler->before($method)) {
if ($method && method_exists($handler, $method)) {
$handler->$method();
- } else if (method_exists($handler, 'index')) {
+ } else /* if (method_exists($handler, 'index')) */ {
$handler->index($method);
}
$handler->after();