Skip to content

Commit 7e0a273

Browse files
authored
fix: use property_exists for checking key id (#395)
1 parent abc63f3 commit 7e0a273

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/JWT.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public static function decode($jwt, $keyOrKeyArray)
111111
throw new UnexpectedValueException('Algorithm not supported');
112112
}
113113

114-
$key = self::getKey($keyOrKeyArray, empty($header->kid) ? null : $header->kid);
114+
$key = self::getKey($keyOrKeyArray, property_exists($header, 'kid') ? $header->kid : null);
115115

116116
// Check the algorithm
117117
if (!self::constantTimeEquals($key->getAlgorithm(), $header->alg)) {

0 commit comments

Comments
 (0)