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');
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 = [ // Action
'status' => false, switch (!empty($_GET['action']) ? $_GET['action'] : false) {
'message' => _('API requests disabled by the node owner.'),
];
}
// Action
switch (!empty($_GET['action']) ? $_GET['action'] : false) {
// Search API // Search API
case 'search'; case 'search';
@ -78,6 +72,14 @@ switch (!empty($_GET['action']) ? $_GET['action'] : false) {
'status' => false, 'status' => false,
'message' => _('Undefined API action request.'), 'message' => _('Undefined API action request.'),
]; ];
}
} else {
$response = [
'status' => false,
'message' => _('API requests disabled by the node owner.'),
];
} }
// Output // Output

Loading…
Cancel
Save