summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-06-20 00:35:23 +0500
committerilotterytea <iltsu@alright.party>2025-06-20 00:35:23 +0500
commit3e0ec942de55004d8ee4bc4344b9743727d5c413 (patch)
tree46858222e33137beb30c78fcb693e7cc235d7a05
parentf7a821300b6e03306572c113199d4fa0f2ad07f4 (diff)
fix: check if HTTP_ACCEPT is set
-rw-r--r--lib/utils.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils.php b/lib/utils.php
index 085ed05..81b6bf2 100644
--- a/lib/utils.php
+++ b/lib/utils.php
@@ -1,6 +1,6 @@
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/../config.php';
-define('IS_JSON_REQUEST', $_SERVER['HTTP_ACCEPT'] == 'application/json');
+define('IS_JSON_REQUEST', isset($_SERVER['HTTP_ACCEPT']) && $_SERVER['HTTP_ACCEPT'] == 'application/json');
function json_response(mixed $data, string|null $message, int $code = 200)
{