fix API_ENABLED condition

This commit is contained in:
ghost 2023-04-23 03:25:43 +03:00
parent 13431008c4
commit 0df47efa8b

View File

@ -9,13 +9,7 @@ require_once('../library/parser.php');
require_once('../library/mysql.php'); require_once('../library/mysql.php');
require_once('../library/sphinxql.php'); require_once('../library/sphinxql.php');
if (!API_ENABLED) { if (API_ENABLED) {
$response = [
'status' => false,
'message' => _('API requests disabled by the node owner.'),
];
}
// Action // Action
switch (!empty($_GET['action']) ? $_GET['action'] : false) { switch (!empty($_GET['action']) ? $_GET['action'] : false) {
@ -80,6 +74,14 @@ switch (!empty($_GET['action']) ? $_GET['action'] : false) {
]; ];
} }
} else {
$response = [
'status' => false,
'message' => _('API requests disabled by the node owner.'),
];
}
// Output // Output
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: application/json; charset=utf-8');