suppress PHP errors/output before JSON in API handler

This commit is contained in:
Daniel committed 2026-04-06 22:54:27 +02:00
1 parent 1b97c681e0
commit 61b19286ba
1 file changed
+2
+2
View File
@@ -86,6 +86,8 @@ function checkUpstream(string $host, int $port): bool {
// ─── API handlers ───────────────────────────────────────────────────────────── // ─── API handlers ─────────────────────────────────────────────────────────────
if (isset($_GET['action'])) { if (isset($_GET['action'])) {
while (@ob_end_clean());
ini_set('display_errors', 0);
header('Content-Type: application/json'); header('Content-Type: application/json');
switch ($_GET['action']) { switch ($_GET['action']) {