Update: 2026-05-07 03:50:16

This commit is contained in:
Hamza-Ayed
2026-05-07 03:50:16 +03:00
parent 209f721cd6
commit bd7164ed23
9 changed files with 464 additions and 146 deletions

View File

@@ -19,15 +19,14 @@ function outputErrorImage($message) {
exit;
}
// Extract token from header OR query string
$headers = getallheaders();
$authHeader = $headers['Authorization'] ?? $headers['authorization'] ?? '';
$token = '';
if (preg_match('/Bearer\s(\S+)/', $authHeader, $matches)) {
$token = $matches[1];
} elseif (isset($_GET['token'])) {
$token = $_GET['token'];
// Extract token from header OR query string using helper
$token = input('token');
if (!$token) {
$headers = getallheaders();
$authHeader = $headers['Authorization'] ?? $headers['authorization'] ?? '';
if (preg_match('/Bearer\s(\S+)/', $authHeader, $matches)) {
$token = $matches[1];
}
}
if (!$token) outputErrorImage('Forbidden: No token');