edenleung /
think-jwt
| 1 | <?php |
||||
| 2 | |||||
| 3 | declare(strict_types=1); |
||||
| 4 | |||||
| 5 | namespace xiaodi\JWTAuth\Handle; |
||||
| 6 | |||||
| 7 | class Header extends RequestToken |
||||
| 8 | { |
||||
| 9 | public function handle() |
||||
| 10 | { |
||||
| 11 | $authorization = $this->app->request->header('authorization'); |
||||
| 12 | |||||
| 13 | if (!$authorization || strpos($authorization, 'Bearer ') !== 0) { |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 14 | return; |
||||
| 15 | } |
||||
| 16 | |||||
| 17 | return substr($authorization, 7); |
||||
|
0 ignored issues
–
show
It seems like
$authorization can also be of type array; however, parameter $string of substr() does only seem to accept string, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 18 | } |
||||
| 19 | } |
||||
| 20 |