Browse Source

fix API_ENABLED condition

main
ghost 2 years ago
parent
commit
0df47efa8b
  1. 20
      public/api.php

20
public/api.php

@ -9,16 +9,10 @@ require_once('../library/parser.php'); @@ -9,16 +9,10 @@ require_once('../library/parser.php');
require_once('../library/mysql.php');
require_once('../library/sphinxql.php');
if (!API_ENABLED) {
if (API_ENABLED) {
$response = [
'status' => false,
'message' => _('API requests disabled by the node owner.'),
];
}
// Action
switch (!empty($_GET['action']) ? $_GET['action'] : false) {
// Action
switch (!empty($_GET['action']) ? $_GET['action'] : false) {
// Search API
case 'search';
@ -78,6 +72,14 @@ switch (!empty($_GET['action']) ? $_GET['action'] : false) { @@ -78,6 +72,14 @@ switch (!empty($_GET['action']) ? $_GET['action'] : false) {
'status' => false,
'message' => _('Undefined API action request.'),
];
}
} else {
$response = [
'status' => false,
'message' => _('API requests disabled by the node owner.'),
];
}
// Output

Loading…
Cancel
Save