Update: 2026-05-07 03:50:16
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user