From 116b58b046351854b64e5aada83f3d88223d7575 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Mon, 7 Feb 2022 06:59:09 -0800 Subject: [PATCH] fix: use property_exists for checking key id --- src/JWT.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JWT.php b/src/JWT.php index 1226102c..6130c59c 100644 --- a/src/JWT.php +++ b/src/JWT.php @@ -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)) {