Skip to content

Commit

Permalink
fix: use property_exists for checking key id (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Feb 7, 2022
1 parent abc63f3 commit 7e0a273
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static function decode($jwt, $keyOrKeyArray)
throw new UnexpectedValueException('Algorithm not supported');
}

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

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

0 comments on commit 7e0a273

Please sign in to comment.