fix: compatibilidad PHP 7.4 — str_starts_with, str_contains, match, never, mixed
This commit is contained in:
+2
-2
@@ -19,7 +19,7 @@ class Auth
|
||||
?? $_SERVER['REDIRECT_HTTP_AUTHORIZATION']
|
||||
?? '';
|
||||
|
||||
if (!str_starts_with($header, 'Bearer ')) {
|
||||
if (strpos($header, 'Bearer ') !== 0) {
|
||||
self::abort(401, 'Token de autorización requerido.');
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ class Auth
|
||||
return base64_decode(strtr($data, '-_', '+/'));
|
||||
}
|
||||
|
||||
private static function abort(int $code, string $message): never
|
||||
private static function abort(int $code, string $message): void
|
||||
{
|
||||
http_response_code($code);
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
Reference in New Issue
Block a user