Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8471e68

Browse files
authored
Change replace() to substr() to remove Bearer
1 parent a8a960a commit 8471e68

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎decode-header.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
}
1313

1414
$token = $headers["Authorization"];
15-
$token = str_replace("Bearer ", "", $token); // or remove 'Bearer ' from first of letters!
15+
// Remove "Bearer " at first of TOKEN
16+
$token = substr($a, 7)); // strlen("Bearer ") = 7
1617

1718
try {
1819
$decode = JWT::decode($token, $key, array('HS256'));

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /